Skip to content

security(osv): preserve direct-tarball provenance instead of npm false positives #1096

Description

@seonghobae

Exact downstream defect

The organization-required Security Scan produces false-positive OSV failures when a pnpm lock entry uses an official direct tarball that intentionally carries a package version newer than the last vulnerable npm registry release.

Current central owner: protected .github main@c47afc2dc68488292c1db7c9d6f82dcd5360f181, .github/workflows/security-scan.yml.

Concrete downstream reproduction: ContextualWisdomLab/inkspan#318 predecessor exact head 9f1c8b732e9b91f152cfff2e9277b758c0959c4a, Security Scan run 32013961603, OSV job/check 95339355813, debug artifact 9282795069 (osv-scan-debug). The Inkspan lock pins SheetJS from the official immutable CDN tarball https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz.

The captured new-results.json classifies that lock entry as:

{"name":"xlsx","version":"0.20.3","ecosystem":"npm"}

and reports both GHSA-4r6h-8v6p-xvw6 / CVE-2023-30533 and GHSA-5pgg-2g8v-p4x9 / CVE-2024-22363. The same evidence embeds database_specific.last_known_affected_version_range values < 0.19.3 and < 0.20.2 respectively. Therefore 0.20.3 is outside both affected ranges, but the npm advisory records expose an open-ended SEMVER range because the fixed SheetJS releases are not npm-registry releases. Treating the direct CDN tarball as ordinary npm ecosystem evidence makes a patched package look permanently vulnerable.

This is a central scanner/provenance classification defect, not an Inkspan product vulnerability. An Inkspan-local advisory ignore would hide the causal control-plane defect and is not acceptable.

First causal boundary

The central workflow delegates direct manifest/lock evidence to OSV Scanner with --no-resolve and then treats the resulting npm-ecosystem finding as authoritative without retaining/validating the pnpm resolution origin. For direct immutable tarballs, package name/version alone is insufficient provenance for npm advisory semantics.

Required test-first repair

  1. Add a RED central contract fixture containing a pnpm lock entry for exact official SheetJS CDN tarball xlsx-0.20.3.tgz; prove the current gate incorrectly fails it against the two GHSA records above.
  2. Add a vulnerable control fixture (for example an npm-registry xlsx@0.18.5) that must continue to fail.
  3. Preserve package-source provenance when interpreting OSV results. A finding may be suppressed/normalized only when an exact immutable non-registry source can be proven, its package/version identity is exact, and authoritative advisory metadata proves that exact source version is outside the affected range. Unknown, mutable, malformed, redirected, or unverifiable source identity must fail closed.
  4. Do not add blanket GHSA ignores, package-name ignores, severity downgrades, continue-on-error, or a generic xlsx exception.
  5. Keep the existing base/head diff semantics, exact PR head checkout, hard fail-on-new-vulnerability behavior, Trivy/dependency-review independence, immutable action pins, and least-privilege permissions.
  6. Add an explicit malformed-source fixture and an npm xlsx@0.18.5 fixture to prove source confusion cannot manufacture green evidence.
  7. Run focused contract tests plus the complete central security/quality suite, then canary on an exact current Inkspan fix(review): put contract-reliable reasoning models first, flagships last #318 head that still pins the same official 0.20.3 CDN tarball.

GREEN acceptance

  • direct official CDN xlsx@0.20.3 is not classified as a vulnerable npm release merely because its lock entry has the same package name;
  • npm-registry vulnerable xlsx@0.18.5 still hard-fails;
  • unknown/unverifiable direct sources fail closed or remain findings;
  • the resulting OSV evidence records package source/provenance sufficiently to audit why a finding was retained or excluded;
  • Inkspan reruns Security Scan on the then-current exact PR head and obtains fresh evidence; predecessor success is not transferred.

Inkspan-side revalidation criterion

After the central repair reaches protected .github main, rerun the required Security Scan for the unchanged then-current ContextualWisdomLab/inkspan#318 head and require the OSV job to inspect the official xlsx-0.20.3 tarball without those two false-positive npm-ecosystem findings. All other required Inkspan checks remain independently required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: authAuthentication, authorization, identity, or tenant isolationarea: ci-cdCI, GitHub Actions, checks, release, or supply chainarea: dependenciesDependency or lockfile maintenancearea: securitySecurity boundary, hardening, or vulnerability preventionpriority: highHigh-priority or P1 workstatus: triagedOpen issue has an organization taxonomy assignmenttype: securitySecurity vulnerability or security-specific remediation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions