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

CycloneDX Reporter uses EPSS score without that method being set #9556

Closed
wkl3nk opened this issue Dec 6, 2024 · 9 comments · Fixed by #9557
Closed

CycloneDX Reporter uses EPSS score without that method being set #9556

wkl3nk opened this issue Dec 6, 2024 · 9 comments · Fixed by #9557
Assignees
Labels
bug Issues that are considered to be bugs reporter About the reporter tool

Comments

@wkl3nk
Copy link
Contributor

wkl3nk commented Dec 6, 2024

Describe the bug

During a scan, a CycloneDX report is requested.
In the CycloneDX SBOM document (version 1.5), is contains a section as follows:

...
  <vulnerabilities>
    <vulnerability>
      <id>CVE-2020-15250</id>
      <ratings>
        <rating>
          <source>
            <url>https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2020-15250.json</url>
          </source>
          <score>4.0</score>
          <severity>medium</severity>
        </rating>
        <rating>
          <source>
            <url>https://api.first.org/data/v1/epss?cve=CVE-2020-15250</url>
          </source>
          <score>7.600000244565308E-4</score>
        </rating>
...

Cross-checking with the related XML schema file, the data type for score is xs:Decimal.

<xs:element name="score" type="xs:decimal" minOccurs="0" maxOccurs="1">

The number 7.600000244565308E-4 seems to have the wrong representation here.

ORT version: 42.0.0

@wkl3nk wkl3nk added bug Issues that are considered to be bugs to triage Issues that need triaging labels Dec 6, 2024
@sschuberth
Copy link
Member

What's the score of that vulnerability in ORT's advisor result? Can you also double-check with the JSON representation of the same CycloneDX report? Because there are several XML-specific bugs in the CycloneDX Java library.

@sschuberth sschuberth added reporter About the reporter tool needs info An issue where further information is required and removed to triage Issues that need triaging labels Dec 6, 2024
@sschuberth
Copy link
Member

<score>7.600000244565308E-4</score>

This simply looks like the EPSS value is being used instead of the CVSS base score.

sschuberth added a commit that referenced this issue Dec 6, 2024
Do not require an exact match of method names, but map according to CVSS
prefixes known to ORT.

Resolves #9556.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
@sschuberth
Copy link
Member

@wkl3nk can you try what you get with #9557?

@sschuberth
Copy link
Member

sschuberth commented Dec 6, 2024

Cross-checking with the related XML schema file, the data type for score is xs:Decimal.

Interesting. The CycloneDX Java library that we use, uses Double in its API (which makes sense). So I believe this to be a bug in the XML schema that you should report upstream.

Edit: Scratch that, `xs:decimal does include floating-point numbers.

@sschuberth sschuberth self-assigned this Dec 6, 2024
@sschuberth sschuberth removed the needs info An issue where further information is required label Dec 6, 2024
@sschuberth sschuberth changed the title CycloneDX Reporter creates invalid score value (7.600000244565308E-4) CycloneDX Reporter uses EPSS score without that method being set Dec 6, 2024
sschuberth added a commit that referenced this issue Dec 6, 2024
Do not require an exact match of method names, but map according to CVSS
prefixes known to ORT.

Resolves #9556.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
@wkl3nk
Copy link
Contributor Author

wkl3nk commented Dec 6, 2024

I guess it is beneficial if I give more context:
A user of ORT Server had this bom.cyclonedx.xml file generated. His goal was to upload the BOM to "Dependency Track". He has checked out the issue with different boms and some are accepted by DT, while others are not. He found a validator for the schema at https://cyclonedx.github.io/cyclonedx-web-tool/validate and there he got the information

Validation failed at line number 380 and position 40: The 'http://cyclonedx.org/schema/bom/1.5:score' element is invalid - The value '7.600000244565308E-4' is invalid according to its datatype 'http://www.w3.org/2001/XMLSchema:decimal' - The string '7.600000244565308E-4' is not a valid Decimal value.

@sschuberth
Copy link
Member

Ok, but still, this is nothing we can fix on our side, I believe. IMO the problem is with how the CycloneDX Java library serializes this specific double value.

@sschuberth
Copy link
Member

@wkl3nk can you try what you get with #9557?

Please still give my PR a try. If should more reliable add the respective method, and maybe we can simply filter out EPSS values that way, as they tend to be small, resulting in those E-notation serializations.

sschuberth added a commit that referenced this issue Dec 6, 2024
Resolves #9556.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
@sschuberth
Copy link
Member

maybe we can simply filter out EPSS values that way, as they tend to be small, resulting in those E-notation serializations.

I've implemented that now.

@sschuberth
Copy link
Member

So I believe this to be a bug in the XML schema that you should report upstream.

The bug is not in the schema, but IMO in the serialization library (at least that's probably the easiest place to fix it), so I've filed this.

sschuberth added a commit that referenced this issue Dec 7, 2024
Resolves #9556.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that are considered to be bugs reporter About the reporter tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants