Skip to content

OSV npm vulnerability not matched: MAL-2022-1471 for pkg:npm/[email protected] #5716

Closed

Description

@aharonh

Description

DependencyTrack 4.13.6 is not matching OSV npm vulnerabilities to components when the vulnerability uses SEMVER range notation with "introduced": "0".

Environment

  • DependencyTrack Version: 4.13.6 (apiserver)
  • Deployment: Kubernetes (Helm chart 0.40.0)
  • Database: PostgreSQL (Cloud SQL)
  • OSV Mirroring: Enabled with npm ecosystem
  • Internal Analyzer: Enabled

Steps to Reproduce

  1. Enable OSV vulnerability source with npm ecosystem in Administration → Vulnerability Sources → Google OSV Advisories
  2. Wait for OSV npm download to complete (or restart apiserver)
  3. Add component pkg:npm/[email protected] to a project via SBOM upload
  4. Trigger vulnerability analysis (re-analyze project or upload new SBOM)
  5. Check component vulnerabilities

Expected Behavior

The component pkg:npm/[email protected] should show vulnerability MAL-2022-1471 from OSV.

OSV vulnerability data:

This range should match ALL versions including 0.2.0.

Actual Behavior

The component shows zero vulnerabilities.

API Evidence:

Vulnerability exists in database:
```bash
GET /api/v1/vulnerability/source/OSV/vuln/MAL-2022-1471
```

Response shows:
```json
{
"vulnId": "MAL-2022-1471",
"source": "OSV",
"affectedProjectCount": 0,
"affectedComponents": [
{
"identityType": "PURL",
"identity": "pkg:npm/bats-file"
}
]
}
```

Component exists with correct PURL:
```bash
GET /api/v1/component/{uuid}
```

Response shows:
```json
{
"name": "bats-file",
"version": "0.2.0",
"purl": "pkg:npm/[email protected]",
"vulnerabilities": null
}
```

Root Cause

DependencyTrack's version matching logic cannot properly parse OSV's SEMVER range notation {"introduced": "0"} to match it against component version 0.2.0.

Logs

OSV npm download completes successfully:
```
2026-01-18 13:31:01,452 INFO [OsvDownloadTask] Updating datasource with Google OSV advisories for ecosystem npm
```

Analysis runs but only shows Internal and OssIndex analyzers, no separate OSV analyzer:
```
2026-01-19 12:59:56 INFO [InternalAnalysisTask] Internal analysis complete
2026-01-19 13:00:24 INFO [OssIndexAnalysisTask] Sonatype OSS Index analysis complete
```

Related Issues

This appears to be related to #2826 (Add support for `vers` version ranges and ecosystem-specific version comparisons), which mentions:

"The version comparison logic DT has today is generic and is struggling to deal with versioning schemes that are specific to certain ecosystems."

Impact

OSV is a critical data source for detecting malicious npm packages, supply chain attacks, and other vulnerabilities not covered by traditional CVE databases. Without proper version range matching, OSV integration is severely limited for npm ecosystems.

Workaround

None identified. Re-uploading SBOMs and re-analysis do not resolve the matching issue.

Activity

  1. added a commit that references this issue on Jan 20, 2026
    7fa73f2
  2. aharonh commented on Jan 20, 2026

    @aharonh
    Author

    Fix Submitted

    Created PR #5718 with a potential fix for this issue.

    The Fix:
    Remove the filter that was discarding "0" values from versionStartIncluding. The vers library can properly handle >= 0 ranges using SEMVER comparison.

    Changed: OsvDownloadTask.java:803-805

    Please review and test. If this approach is correct, it should enable matching for npm malicious packages and other OSV vulnerabilities with {"introduced": "0"} ranges.

  3. added 2 commits that reference this issue on Jan 20, 2026
    8775f01
    703ed8d
  4. added
    defect
    size/S
    integration/osv
    on Jan 20, 2026
  5. added this to the 4.14.0 milestone on Jan 20, 2026
  6. modified the milestones: 4.14.0, 5.1.1 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

    defectintegration/osvsize/S

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions