/

CVE-2026-19693

Severity:

HIGH RISK

(8.1)

Path Traversal (CWE-22) in extract-zip Archive Extraction

CVE-2026-19693

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22, CWE-59

Impact:

Arbitrary File Write

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal and symlink-handling flaw in extract-zip can allow archive contents to escape the intended extraction directory. When an archive places a symlink outside the destination before a regular file with the same name, extraction may write through the symlink and modify an arbitrary file.

Affected context

The issue occurs in applications that use extract-zip to unpack archives and rely on its containment checks to keep extracted files within a destination directory. Risk increases when an attacker can provide or influence an archive containing duplicate entry names, including a symlink followed by a regular file, and when the extraction process has permissions to write outside the intended directory through filesystem links.

Exploit preconditions

  • Attack surface: Archive extraction performed through extract-zip
  • Required access: Ability to supply, replace, or influence an archive being extracted
  • Trigger point: Processing archive entries, particularly a symlink followed by a regular file with the same name
  • Filesystem condition: The extraction process can create or follow symlinks and has write access to the targeted location
  • Why exploitation is possible: The containment check evaluates only the parent directory and does not sufficiently validate the entry's final path component

Why this happens

The underlying flaw is incomplete path containment validation combined with unsafe symlink handling. The extractor checks whether an entry's parent directory remains within the destination, but does not fully validate the resolved final path before writing. A previously created symlink can therefore redirect a later file write outside the extraction root. This maps primarily to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, with CWE-59: Improper Link Resolution Before File Access describing the unsafe filesystem-link behavior.

Potential impact

  • An attacker may overwrite or create files outside the intended extraction directory
  • Application configuration, scripts, or other sensitive files could be modified
  • The affected process may experience code execution if a writable target is later executed or loaded
  • Data integrity, service availability, or system isolation could be compromised

General mitigation guidance

Mitigation generally focuses on treating archive contents as untrusted filesystem operations rather than ordinary file copies.

Common defensive patterns include:

  • Resolve and validate the complete destination path, including the final component, before writing
  • Reject symlink and hard-link entries unless there is a well-defined, safe requirement for them
  • Prevent writes through links by using link-safe filesystem operations and appropriate no-follow controls
  • Extract into an isolated, least-privileged workspace with narrowly scoped permissions
  • Apply resource limits and restrict archive entry types, duplicate names, and unusual paths
  • Avoid allowing extracted content to overwrite existing application or system files

How teams detect issues like this

Organizations commonly identify this class of issue through:

  • Static analysis and code review checks for archive extraction without complete canonical-path validation
  • Review signals involving symlink creation, duplicate archive entries, path normalization, and filesystem writes
  • Dynamic tests using traversal paths, symlink entries, hard links, duplicate names, and destination-boundary assertions
  • Security policies requiring extraction into isolated directories with no-follow or link-restriction controls
  • Dependency and software composition analysis for archive libraries with known path or link-resolution weaknesses

Sources

SourceLink
github.comgithub.com/max-mapper/extract-zip
npmjs.comnpmjs.com/package/extract-zip

Frequently asked

questions

It can be remotely exploitable when an application accepts attacker-controlled archives through a network-accessible upload, import, or processing feature. In other deployments, local access or access to an internal archive-ingestion workflow may be required.

The attacker generally needs the ability to provide or influence an archive that the vulnerable extraction code processes. The resulting impact also depends on the permissions of the extracting process and the files reachable through symlinks.

Use archive extraction logic that validates the fully resolved destination path for every entry, rejects unsafe link types, and performs writes with protections against link traversal.

Treat archive contents as untrusted, test duplicate and link-based entries, extract in a least-privileged isolated workspace, and enforce dependency and code-review policies for path and symlink handling.

Find out what's already
exploitable in your codebase.