CVE-2025-59343: Tar fs Tar-fs Has A Symlink Validation Vulnerability

HIGH
Advisory Identifier: GHSA-vj76-c3g6-qr5v
CWE-61 CWE-22
Published
Advisory Summary

CVE-2025-59343 is a HIGH tar-fs has a symlink validation vulnerability (CWE-61: UNIX Symbolic Link (Symlink) Following) affecting Tar fs libraries in the npm ecosystem. The issue involves tar-fs has a symlink validation bypass if destination directory is predictable with a specific tarball. Remediation is available by upgrading affected packages to version 3.1.1, 2.1.4, 1.16.6.

CVE-2025-59343 at a Glance

CVE Identifier CVE-2025-59343
GHSA Identifier GHSA-vj76-c3g6-qr5v
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-61: UNIX Symbolic Link (Symlink) Following
Affected Product Tar fs
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-59343

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: 3.1.1
npm install tar-fs@3.1.1
tar-fs fixed: 2.1.4
npm install tar-fs@2.1.4
tar-fs fixed: 1.16.6
npm install tar-fs@1.16.6
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-59343, 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 3.1.1), 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-61: UNIX Symbolic Link (Symlink) Following, where the product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. this could allow an attacker to cause the product to operate on unauthorized files. 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.1.0, v2.1.3, v1.16.5 and below ### Patches Has been patched in 3.1.1, 2.1.4, and 1.16.6 ### 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 Reported by: Mapta / BugBunny_ai

CVE-2025-59343 Affected Tar fs Versions

3 component(s)
Fixed Versions:
3.1.12.1.41.16.6
Product / Package Ecosystem Affected Versions Fixed Version
tar-fs
npm
≥ 3.0.0
< 3.1.1
3.1.1
tar-fs
npm
≥ 2.0.0
< 2.1.4
2.1.4
tar-fs
npm
< 1.16.6
1.16.6

References

Frequently Asked Questions

What is CVE-2025-59343?
CVE-2025-59343 is a security vulnerability in Tar fs involving tar-fs has a symlink validation bypass if destination directory is predictable with a specific tarball under CWE-61: UNIX Symbolic Link (Symlink) Following.
Which Tar fs versions are affected?
Affected versions include releases prior to 3.1.1, 2.1.4, 1.16.6 across affected packages: tar-fs.
What version fixes CVE-2025-59343?
Upgrading to 3.1.1, 2.1.4, 1.16.6 (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 3.1.1, 2.1.4, 1.16.6. Upgrade your dependency to 3.1.1, 2.1.4, 1.16.6 or later.
What CWE is associated with CVE-2025-59343?
CVE-2025-59343 is classified under CWE-61: UNIX Symbolic Link (Symlink) Following (The product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. This could allow an attacker to cause the product to operate on unauthorized files.).
How can I check npm dependencies for CVE-2025-59343?
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-vj76-c3g6-qr5v",
  "modified" : "2025-11-03T21:34:35Z",
  "published" : "2025-09-24T18:57:04Z",
  "aliases" : [ "CVE-2025-59343" ],
  "summary" : "tar-fs has a symlink validation bypass if destination directory is predictable with a specific tarball",
  "details" : "### Impact\n v3.1.0, v2.1.3, v1.16.5 and below\n\n### Patches\nHas been patched in 3.1.1, 2.1.4, and 1.16.6\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\nReported by: Mapta / BugBunny_ai",
  "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" : "3.0.0"
      }, {
        "fixed" : "3.1.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "tar-fs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.1.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "tar-fs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.16.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mafintosh/tar-fs/security/advisories/GHSA-vj76-c3g6-qr5v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-59343"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mafintosh/tar-fs/commit/0bd54cdf06da2b7b5b95cd4b062c9f4e0a8c4e09"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mafintosh/tar-fs"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2025/09/msg00028.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-61" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-09-24T18:57:04Z",
    "nvd_published_at" : "2025-09-24T18:15:42Z"
  }
}