CVE-2025-5981: Github.com/google/osv scalibr Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-2hcm-q3f4-fjgw
CWE-427 CWE-22
Published
Advisory Summary

CVE-2025-5981 is a MODERATE path traversal vulnerability (CWE-427: Uncontrolled Search Path Element) affecting Github.com/google/osv scalibr libraries in the Go ecosystem. The issue involves osv-scalibr's container image unpacking vulnerable to arbitrary file write via path traversal. Remediation is available by upgrading affected packages to version 0.2.1.

CVE-2025-5981 at a Glance

CVE Identifier CVE-2025-5981
GHSA Identifier GHSA-2hcm-q3f4-fjgw
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-427: Uncontrolled Search Path Element
Affected Product Github.com/google/osv scalibr
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2025-5981

To remediate this vulnerability, upgrade all affected Github.com/google/osv scalibr dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/google/osv-scalibr fixed: 0.2.1
Upgrade github.com/google/osv-scalibr to 0.2.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/google/osv-scalibr

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-5981, inspect your project dependencies for Github.com/google/osv scalibr:

inspect dependencies for github.com/google/osv-scalibr

Analyze the terminal output to locate any version of Github.com/google/osv scalibr in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-427: Uncontrolled Search Path Element, where the product uses a fixed or controlled search path to find resources, but one or more locations in that path can be under the control of unintended actors. In Github.com/google/osv scalibr, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Arbitrary file write as the OSV-SCALIBR user on the host system via a path traversal vulnerability when using OSV-SCALIBR's unpack() function for container images. Particularly, when using the CLI flag --remote-image on untrusted container images.

CVE-2025-5981 Affected Github.com/google/osv scalibr Versions

1 component(s)
Fixed Versions:
0.2.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/google/osv-scalibr
Go
≥ 0.1.3
< 0.2.1
0.2.1

References

Frequently Asked Questions

What is CVE-2025-5981?
CVE-2025-5981 is a security vulnerability in Github.com/google/osv scalibr involving OSV-SCALIBR's Container Image Unpacking Vulnerable to Arbitrary File Write via Path Traversal under CWE-427: Uncontrolled Search Path Element.
Which Github.com/google/osv scalibr versions are affected?
Affected versions include releases prior to 0.2.1 across affected packages: github.com/google/osv-scalibr.
What version fixes CVE-2025-5981?
Upgrading to 0.2.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/google/osv-scalibr affected?
Yes, github.com/google/osv-scalibr is affected in releases prior to 0.2.1. Upgrade your dependency to 0.2.1 or later.
What CWE is associated with CVE-2025-5981?
CVE-2025-5981 is classified under CWE-427: Uncontrolled Search Path Element (The product uses a fixed or controlled search path to find resources, but one or more locations in that path can be under the control of unintended actors.).
How can I check Go dependencies for CVE-2025-5981?
Run the dependency tree command: 'inspect dependencies for github.com/google/osv-scalibr'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2hcm-q3f4-fjgw",
  "modified" : "2025-08-07T18:21:23Z",
  "published" : "2025-06-18T09:30:31Z",
  "aliases" : [ "CVE-2025-5981" ],
  "summary" : "OSV-SCALIBR's Container Image Unpacking Vulnerable to Arbitrary File Write via Path Traversal",
  "details" : "Arbitrary file write as the OSV-SCALIBR user on the host system via a path traversal vulnerability when using OSV-SCALIBR's unpack() function for container images. Particularly, when using the CLI flag --remote-image on untrusted container images.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:A/VC:H/VI:L/VA:N/SC:H/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/google/osv-scalibr"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.1.3"
      }, {
        "fixed" : "0.2.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-5981"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/google/osv-scalibr/commit/2444419b1818c2d6917fc3394c947fb3276e9d59"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/google/osv-scalibr"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/google/osv-scalibr/releases/tag/v0.1.8"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2025-3767"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-427" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-06-18T19:45:44Z",
    "nvd_published_at" : "2025-06-18T09:15:47Z"
  }
}