CVE-2025-48387: Tar fs Tar-fs Can Extract Outside The Vulnerability

HIGH
Advisory Identifier: GHSA-8cj5-5rvv-wf4v
CWE-22
Published
Advisory Summary

CVE-2025-48387 is a HIGH tar-fs can extract outside the vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Tar fs libraries in the npm ecosystem. The issue involves tar-fs can extract outside the specified dir with a specific tarball. Remediation is available by upgrading affected packages to version 1.16.5, 2.1.3, 3.0.9.

CVE-2025-48387 at a Glance

CVE Identifier CVE-2025-48387
GHSA Identifier GHSA-8cj5-5rvv-wf4v
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Tar fs
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-48387

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

tar-fs fixed: 1.16.5
npm install tar-fs@1.16.5
tar-fs fixed: 2.1.3
npm install tar-fs@2.1.3
tar-fs fixed: 3.0.9
npm install tar-fs@3.0.9
Verify Direct and Transitive Dependencies

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

npm ls tar-fs

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-48387, inspect your project dependencies using npm:

npm ls tar-fs

Analyze the terminal output to locate any version of Tar fs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.16.5), your application is affected.

Note: The npm ls tar-fs command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Tar fs, 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

### Impact v3.0.8, v2.1.2, v1.16.4 and below ### Patches Has been patched in 3.0.9, 2.1.3, and 1.16.5 ### Workarounds You can use the ignore option to ignore non files/directories. ```js ignore (_, header) { // pass files & directories, ignore e.g. symlinks return header.type !== 'file' && header.type !== 'directory' } ``` ### Credit Thank you Caleb Brown from Google Open Source Security Team for reporting this in detail.

CVE-2025-48387 Affected Tar fs Versions

3 component(s)
Fixed Versions:
1.16.52.1.33.0.9
Product / Package Ecosystem Affected Versions Fixed Version
tar-fs
npm
< 1.16.5
1.16.5
tar-fs
npm
≥ 2.0.0
< 2.1.3
2.1.3
tar-fs
npm
≥ 3.0.0
< 3.0.9
3.0.9

References

Frequently Asked Questions

What is CVE-2025-48387?
CVE-2025-48387 is a security vulnerability in Tar fs involving tar-fs can extract outside the specified dir with a specific tarball under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Tar fs versions are affected?
Affected versions include releases prior to 1.16.5, 2.1.3, 3.0.9 across affected packages: tar-fs.
What version fixes CVE-2025-48387?
Upgrading to 1.16.5, 2.1.3, 3.0.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tar-fs affected?
Yes, tar-fs is affected in releases prior to 1.16.5, 2.1.3, 3.0.9. Upgrade your dependency to 1.16.5, 2.1.3, 3.0.9 or later.
What CWE is associated with CVE-2025-48387?
CVE-2025-48387 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check npm dependencies for CVE-2025-48387?
Run the dependency tree command: 'npm ls tar-fs'. 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-8cj5-5rvv-wf4v",
  "modified" : "2025-11-03T21:33:59Z",
  "published" : "2025-06-03T06:14:25Z",
  "aliases" : [ "CVE-2025-48387" ],
  "summary" : "tar-fs can extract outside the specified dir with a specific tarball",
  "details" : "### Impact\n v3.0.8, v2.1.2, v1.16.4 and below\n\n### Patches\nHas been patched in 3.0.9, 2.1.3, and 1.16.5\n\n### Workarounds\nYou can use the ignore option to ignore non files/directories.\n\n```js\n  ignore (_, header) {\n    // pass files & directories, ignore e.g. symlinks\n    return header.type !== 'file' && header.type !== 'directory'\n  }\n```\n\n### Credit\nThank you Caleb Brown from Google Open Source Security Team for reporting this in detail.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "tar-fs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.16.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "tar-fs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.1.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "tar-fs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.0.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/google/security-research/security/advisories/GHSA-xrg4-qp5w-2c3w"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mafintosh/tar-fs/security/advisories/GHSA-8cj5-5rvv-wf4v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-48387"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mafintosh/tar-fs/commit/647447b572bc135c41035e82ca7b894f02b17f0f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mafintosh/tar-fs"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2025/06/msg00012.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-06-03T06:14:25Z",
    "nvd_published_at" : "2025-06-02T20:15:22Z"
  }
}