Skip to content

Unfixed CVEs from Googles OSV affecting all versions are not found #4948

Closed

Description

@Andre-85

Current Behavior

For example UBUNTU-CVE-2021-26318 is not matched to amd64-microcode version 3.20191218.1ubuntu2.2, but this version is mentioned in the osv CVE report:

{
  "vulns": [
    {
      "id": "UBUNTU-CVE-2021-26318",
      "details": "A timing and power-based side channel attack leveraging the x86 PREFETCH instructions on some AMD CPUs could potentially result in leaked kernel address space information.",
      "modified": "2025-04-23T15:01:25Z",
      "published": "2021-10-13T19:15:00Z",
      "related": [
        "CVE-2021-26318"
      ],
      "references": [
        {
          "type": "REPORT",
          "url": "https://ubuntu.com/security/CVE-2021-26318"
        },
        {
          "type": "REPORT",
          "url": "https://www.amd.com/en/corporate/product-security/bulletin/amd-sb-1017"
        },
        {
          "type": "REPORT",
          "url": "https://www.cve.org/CVERecord?id=CVE-2021-26318"
        }
      ],
      "affected": [
        {
          "package": {
            "name": "amd64-microcode",
            "ecosystem": "Ubuntu:Pro:14.04:LTS",
            "purl": "pkg:deb/ubuntu/[email protected]~ubuntu0.14.04.2+really20130710.1ubuntu1?arch=source&distro=esm-infra-legacy/trusty"
          },
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "versions": [
            "1.20120910-3",
            "2.20131007.1+really20130710.1",
            "3.20180524.1~ubuntu0.14.04.1",
            "3.20180524.1~ubuntu0.14.04.2+really20130710.1",
            "3.20180524.1~ubuntu0.14.04.2+really20130710.1ubuntu1"
          ],
          "ecosystem_specific": {
            "ubuntu_priority": "medium"
          },
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-26318.json"
          }
        },
        {
          "package": {
            "name": "amd64-microcode",
            "ecosystem": "Ubuntu:Pro:16.04:LTS",
            "purl": "pkg:deb/ubuntu/[email protected]+really3.20180524.1~ubuntu0.16.04.2+esm3?arch=source&distro=esm-infra/xenial"
          },
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "versions": [
            "2.20141028.1",
            "2.20160316.1",
            "3.20180524.1~ubuntu0.16.04.1",
            "3.20180524.1~ubuntu0.16.04.2",
            "3.20191021.1ubuntu0.16.04.1",
            "3.20191021.1+really3.20180524.1~ubuntu0.16.04.2",
            "3.20191021.1+really3.20180524.1~ubuntu0.16.04.2+esm1",
            "3.20191021.1+really3.20180524.1~ubuntu0.16.04.2+esm2",
            "3.20191021.1+really3.20180524.1~ubuntu0.16.04.2+esm3"
          ],
          "ecosystem_specific": {
            "ubuntu_priority": "medium"
          },
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-26318.json"
          }
        },
        {
          "package": {
            "name": "amd64-microcode",
            "ecosystem": "Ubuntu:Pro:18.04:LTS",
            "purl": "pkg:deb/ubuntu/[email protected]+really3.20181128.1~ubuntu0.18.04.1+esm3?arch=source&distro=esm-infra/bionic"
          },
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "versions": [
            "3.20160316.3",
            "3.20171205.1",
            "3.20180524.1~ubuntu0.18.04.1",
            "3.20180524.1~ubuntu0.18.04.2",
            "3.20191021.1ubuntu0.18.04.2",
            "3.20191021.1+really3.20181128.1~ubuntu0.18.04.1",
            "3.20191021.1+really3.20181128.1~ubuntu0.18.04.1+esm1",
            "3.20191021.1+really3.20181128.1~ubuntu0.18.04.1+esm2",
            "3.20191021.1+really3.20181128.1~ubuntu0.18.04.1+esm3"
          ],
          "ecosystem_specific": {
            "ubuntu_priority": "medium"
          },
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-26318.json"
          }
        },
        {
          "package": {
            "name": "amd64-microcode",
            "ecosystem": "Ubuntu:20.04:LTS",
            "purl": "pkg:deb/ubuntu/[email protected]?arch=source&distro=focal"
          },
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "versions": [
            "3.20181128.1ubuntu2",
            "3.20191021.1ubuntu1",
            "3.20191218.1ubuntu1",
            "3.20191218.1ubuntu1.1",
            "3.20191218.1ubuntu1.2",
            "3.20191218.1ubuntu1.3"
          ],
          "ecosystem_specific": {
            "ubuntu_priority": "medium"
          },
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-26318.json"
          }
        },
        {
          "package": {
            "name": "amd64-microcode",
            "ecosystem": "Ubuntu:22.04:LTS",
            "purl": "pkg:deb/ubuntu/[email protected]?arch=source&distro=jammy"
          },
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "versions": [
            "3.20191218.1ubuntu2",
            "3.20191218.1ubuntu2.1",
            "3.20191218.1ubuntu2.2",
            "3.20191218.1ubuntu2.3"
          ],
          "ecosystem_specific": {
            "ubuntu_priority": "medium"
          },
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-26318.json"
          }
        },
        {
          "package": {
            "name": "amd64-microcode",
            "ecosystem": "Ubuntu:24.10",
            "purl": "pkg:deb/ubuntu/[email protected]+nmu1ubuntu1.1?arch=source&distro=oracular"
          },
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "versions": [
            "3.20231019.1ubuntu2",
            "3.20240116.2+nmu1ubuntu1",
            "3.20240116.2+nmu1ubuntu1.1"
          ],
          "ecosystem_specific": {
            "ubuntu_priority": "medium"
          },
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-26318.json"
          }
        },
        {
          "package": {
            "name": "amd64-microcode",
            "ecosystem": "Ubuntu:24.04:LTS",
            "purl": "pkg:deb/ubuntu/[email protected]?arch=source&distro=noble"
          },
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "versions": [
            "3.20230808.1.1ubuntu1",
            "3.20231019.1ubuntu1",
            "3.20231019.1ubuntu2",
            "3.20231019.1ubuntu2.1"
          ],
          "ecosystem_specific": {
            "ubuntu_priority": "medium"
          },
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-26318.json"
          }
        },
        {
          "package": {
            "name": "amd64-microcode",
            "ecosystem": "Ubuntu:25.04",
            "purl": "pkg:deb/ubuntu/[email protected]?arch=source&distro=plucky"
          },
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "versions": [
            "3.20240116.2+nmu1ubuntu1",
            "3.20240116.2+nmu1ubuntu1.1",
            "3.20240820.1ubuntu1"
          ],
          "ecosystem_specific": {
            "ubuntu_priority": "medium"
          },
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-26318.json"
          }
        }
      ],
      "schema_version": "1.6.0",
      "severity": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N"
        }
      ]
    }
  ]
}

Steps to Reproduce

  1. Upload a SBOM with amd64-microcode version 3.20191218.1ubuntu2.2. Use: empty-ubuntu-22.04-aws-v4.sbom.json
  2. UBUNTU-CVE-2021-26318 is not shown

Expected Behavior

UBUNTU-CVE-2021-26318 should be shown. Ranges the event "introduced" with "0" and no "fixed" event are present, see in section "Current Behavior", which should be interpreted as all versions affected . Also the affected versions are listed.

But since there is a range present, no single versions are parsed (in OsvAdvisoryParser class) and this range is added as VERSIONSTARTINCLUDING=null and VERSIONENDINCLUDING=null/VERSIONSTARTEXCLUDING=null (in OsvDownloadTask).

Already skipping the dedicated versions is a bug (see ) since both, the range and the dedicated versions should be added.

The main problem is in class AbstractVulnerableSoftwareAnalysisTask because the infinite range (with VERSIONSTARTINCLUDING=null and VERSIONENDINCLUDING=null/VERSIONSTARTEXCLUDING=null) is interpreted as if there is no version range to check at all.

Dependency-Track Version

4.13.0

Dependency-Track Distribution

Container Image

Database Server

H2

Database Server Version

No response

Browser

Mozilla Firefox

Checklist

Activity

  1. added
    defect
    on May 13, 2025
  2. Andre-85 commented on May 13, 2025

    @Andre-85
    Author

    I would say the core problem is that is not clearly defined what null in VERSION{START,END}{EX,IN}CLUDING is. For the start values VERSIONSTART{EX,IN}CLUDING it's easy, since null can be also interpreted as 0, see comment in OsvDownloadTask:

           // Other sources do not populate the versionStartIncluding with 0.
              // Semantically, versionStartIncluding=null is equivalent to >=0.
              // Omit zero values here for consistency's sake.
              final String versionStartIncluding = Optional.ofNullable(affectedPackage.getLowerVersionRange())
                      .filter(version -> !"0".equals(version))
                      .orElse(null);
    
    

    null just means not present and no check and since there are no versions older than 0 comparing is practically a noop (and the same than no checking at all).

    But for VERSIONEND{EX,IN}CLUDING it's not that easy because null can either mean the bug is not fixed (if VERSIONSTART{EX,IN}CLUDING != null) or there is no range at all if (VERSIONSTART{EX,IN}CLUDING == null). The all affected range cannot be coded like this at all.

  3. Andre-85 commented on May 13, 2025

    @Andre-85
    Author

    I thought about following possible alternative solutions for this problem:

    1. Use 0 instead of null for VERSIONSTARTINCLUDING for the all version range. The version comparison in class AbstractVulnerableSoftwareAnalysisTask would recognize there is a version range to use and would just check if the component version is later or equal the version (in this case 0) in VERSIONSTARTINCLUDING, the test for VERSIONEND{EX,IN}CLUDING would be skipped. PRO: easy to do. CON: Comment about starting version 0, see above. Are there side effects?
    2. Use highest possible version number for VERSIONEND{EX,IN}CLUDING. The version comparison in class AbstractVulnerableSoftwareAnalysisTask would recognize there is a version range to use and skip the test for VERSIONSTARTINCLUDING (since still 0) and would only check for VERSIONEND{EX,IN}CLUDING (which is a very high version number). PRO: No change of 0/null semantic. CON: What is the very high version number? It needs to be ecosystem specific for sure.
    3. Use a special value for VERSIONEND{EX,IN}CLUDING. For not making a change to 0/null sematic, use a special character e.g. ''. The version comparison in class AbstractVulnerableSoftwareAnalysisTask would recognize there is a version range. Then treat '' like null in the Version Comparison. PRO: No change of 0/null semantic. CON: Special treatment in version compare needed.
    4. Use a special value for VERSION, use a special character e.g. ''. The version comparison in class AbstractVulnerableSoftwareAnalysisTask would recognize there is a version range. The '' will be treated by Cpe.compareAttribute as a wildcard. PRO: No change of 0/null semantic. CON: Kind of special treatment in version compare needed, range is represented as a single version.
    5. Interpret empty VERSION{START,END}{EX,IN}CLUDING and VERSION matching all targetVersions in AbstractVulnerableSoftwareAnalysisTask. PRO: No new special values inserted. CON: What side effects are possible?

    Further ideas?

  4. added a commit that references this issue on May 13, 2025
  5. Andre-85 commented on May 15, 2025

    @Andre-85
    Author

    I ran a successful first test with strategy no.3. but i'm using - instead of *, since then you can even express in cpe semantics that there is no fixed version available. Since there is already specialized handling of - and * in AbstractVulnerableSoftwareAnalysisTask this does not make it worse i guess ;)

    I will add some unittests and i do some sophisticated testing.

    Image

  6. added a commit that references this issue on May 16, 2025
  7. Andre-85 commented on May 20, 2025

    @Andre-85
    Author

    I saw I broke the test with a database_specific limit. Taking also this in account gives:

    Image

  8. added
    p2
    size/S
    and removed on Oct 3, 2026
  9. added this to the 5.1.1 milestone on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectp2size/S

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions