Skip to content

OSV parser ignores introduced version when considering database_specific field #2323

Description

@keshav-space

The current heuristic for parsing OSV advisories ignores the introduced version when last_known_affected_version_range is available in database_specific field, which is incorrect.

Example:

GHSA-cgjx-mwpx-47jv has following affected range

  {
    "package": {
      "ecosystem": "npm",
      "name": "express-restify-mongoose"
    },
    "ranges": [
      {
        "type": "ECOSYSTEM",
        "events": [
          {
            "introduced": "3.0.0"
          },
          {
            "fixed": "3.1.0"
          }
        ]
      }
    ],
    "database_specific": {
      "last_known_affected_version_range": "<= 3.0.1"
    }
  }

and current osv parser resolves this to:

impacted_packages:
  - purl: pkg:npm/express-restify-mongoose
    affected_versions: vers:npm/<=3.0.1
    fixed_versions: vers:npm/3.1.0

this is incorrect more accurate affected_versions would be vers:npm/>=3.0.0|<=3.0.1.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions