Skip to content

[ingestion/data-quality issue] OSV certifier does not check for affectedness correctly #2496

@lpanni

Description

@lpanni

Describe the bug

The OSV certifier seems to fully rely on the output of the OSV API to determine if a component represented by a purl is affected by a vulnerability.
It does not use the affected array present in OSV API responses to check if the requested version is in the versions list.

To Reproduce
Steps to reproduce the behavior:

  1. guacone collect files --add-vuln-on-ingest busybox.bom.json
    busybox.bom.json
{
  "$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
  "bomFormat": "CycloneDX",
  "specVersion": "1.6",
  "serialNumber": "urn:uuid:7795645e-a7c9-4628-afa4-7de03f656e7f",
  "components": [
    {
      "type": "library",
      "name": "busybox",
      "version": "x86_64#1.36.1-r19",
      "bom-ref": "pkg:apk/alpine/[email protected]?arch=x86_64&distro=alpine-3.19",
      "hashes": [
        {
          "alg": "SHA-1",
          "content": "093ec2d587acd18569b1196e9f59a15c119e685b"
        }
      ],
      "purl": "pkg:apk/alpine/[email protected]?arch=x86_64&distro=alpine-3.19"
    }
  ]
}
  1. guacone query vuln uri urn:uuid:7795645e-a7c9-4628-afa4-7de03f656e7f
  2. See false positive CVEs
+-------------+-----------+----------------------------------+
| NODE TYPE   | NODE ID # | ADDITIONAL INFORMATION           |
+-------------+-----------+----------------------------------+
| certifyVuln | 27        | vulnerability ID: cve-2023-42363 |
| certifyVuln | 28        | vulnerability ID: cve-2023-42364 |
| certifyVuln | 29        | vulnerability ID: cve-2023-42365 |
| certifyVuln | 30        | vulnerability ID: cve-2023-42366 |
+-------------+-----------+----------------------------------+

Those vulnerabilities are fixed in version 1.36.1-r19 in Alpine 3.19, see OSV

Example:

Image

GUAC version

Using version v0.13.2, running via[guac-demo-compose.yaml

Ingested document(s)

See reproduction above.

Additional context

Related Issue in OSV: google/osv.dev#3126
(OSV does not respect disto qualifier when querying with purl. Fixing this in OSV should also fix this issue, but checking the affected versions in the certifier could still be a good idea)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdata-qualityThings related to data quality and document ingestiondata-sources

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions