Skip to content

fix: make VulnerabilityReference arguments mandatory #790

Closed

Description

@indiVar0508

This issue is created from this thread re: #786 (comment)

It's been noticed that VulnerabilityReference class in implementation has defined the attributes id and source as optional
ref: https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/cyclonedx/model/vulnerability.py#L486...L497

but if we refer the documentation of cyclonedx

<bom:references      > [0..1] 
	Start Sequence [0..*] 
	<bom:reference            > [1] 
		<bom:id> xs:normalizedString </bom:id> [1] 
		<bom:source> bom:vulnerabilitySourceType </bom:source> [1] 
	</bom:reference> Allow any elements from a namespace other than this schema's namespace (lax validation). [0..*] End Sequence 
</bom:references>

The refrences is optional but if a reference is defined id and source are mandatory, but current implementation treats these as optional

Activity

  1. jkowalleck commented on Feb 23, 2025

    @jkowalleck
  2. changed the title [-]make VulnerabilityReference arguments are mandatory[/-] [+]make VulnerabilityReference arguments mandatory[/+] on Feb 25, 2025
  3. added
    enhancementNew feature or request
    bugSomething isn't working
    and removed
    enhancementNew feature or request
    on Feb 25, 2025
  4. changed the title [-]make VulnerabilityReference arguments mandatory[/-] [+]fix: make VulnerabilityReference arguments mandatory[/+] on Feb 25, 2025
  5. added this to the 9.0.0 milestone on Feb 25, 2025
  6. jkowalleck commented on Feb 25, 2025

    @jkowalleck
    Member

    this fix will alter public API, and is therefore considered breaking change.
    this is not a stoper, just a remark.

  7. self-assigned this
    on Feb 25, 2025
  8. jkowalleck commented on Feb 25, 2025

    @jkowalleck
    Member

    i'll be working on this

  9. jkowalleck commented on Feb 25, 2025

    @jkowalleck
    Member

    did some research.

    since JSON schema was chosen as the dominant schema, the one that serves as first spec implementation,
    and since XML schema was "fixed" to work same as JSON schema,
    I'd consider it canon/spec that both properties were always mandatory.

  10. added a commit that references this issue on Feb 25, 2025
    3f1ab92
  11. added a commit that references this issue on Feb 26, 2025
  12. jkowalleck commented on Feb 26, 2025

    @jkowalleck
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions