CVE-2025-5981: Github.com/google/osv scalibr Path Traversal Vulnerability
MODERATECVE-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
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.
Upgrade github.com/google/osv-scalibr to 0.2.1
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
CVE-2025-5981 Affected Github.com/google/osv scalibr Versions
1 component(s)| 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?
Which Github.com/google/osv scalibr versions are affected?
What version fixes CVE-2025-5981?
Is github.com/google/osv-scalibr affected?
What CWE is associated with CVE-2025-5981?
How can I check Go dependencies for CVE-2025-5981?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}