Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Produces invalid SBOM file when CVSSv31 method is used in input #359

Closed
lazka opened this issue Mar 26, 2024 · 3 comments
Closed

Produces invalid SBOM file when CVSSv31 method is used in input #359

lazka opened this issue Mar 26, 2024 · 3 comments

Comments

@lazka
Copy link

lazka commented Mar 26, 2024

Input file: buginput.json

Passing the attached SBOM through cyclonedx-cli results in an invalid JSON:

$ cyclonedx --version                                                                
0.25.0
$ # it's valid
$ cyclonedx validate --input-file buginput.json
BOM validated successfully.
$ # converting breaks it
$ cyclonedx convert --input-file buginput.json --output-file converted.json
$ cyclonedx validate --input-file converted.json
Unable to validate against any JSON schemas.
BOM is not valid.
$ # merging breaks it too
$ cyclonedx merge --input-files buginput.json buginput.json --output-file merged.json
$ cyclonedx validate --input-file merged.json   
Unable to validate against any JSON schemas.
BOM is not valid.

from what I see the rating "method" gets encoded wrongly:

{
  "score": 3.3,
  "severity": "low",
  "method": "CVSSv31",
  "vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N"
}

After:

{
  "score": 3.3,
  "severity": "low",
  "method": "CVSSv3.1",
  "vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N"
}
@andreas-hilti
Copy link
Contributor

Is this related to CycloneDX/cyclonedx-dotnet-library#261?

@mtsfoni
Copy link
Contributor

mtsfoni commented May 22, 2024

Should be fixed in 0.25.1

@mtsfoni mtsfoni closed this as completed May 22, 2024
@lazka
Copy link
Author

lazka commented May 23, 2024

Confirmed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants