Junglewise Threat Intelligence

CVE-2026-76845: adm-zip symlink following in archive extraction

CVE-2026-76845 · Severity: medium · CVSS 6.5 · Published 2026-08-24

Executive brief

adm-zip is a popular Node.js library for creating and extracting ZIP archives. The library fails to properly handle symbolic links during extraction, allowing an attacker who can pre-create a symlink in the extraction directory to write arbitrary files outside the intended extraction folder. This could enable an attacker to overwrite critical application files, inject malicious code, or manipulate system configurations in environments where shared or predictable extraction directories are used (such as temporary folders or CI/CD workspaces).

Technical details

The vulnerability is a link-following flaw (CWE-59) in adm-zip's extraction functions. The Utils.sanitize function in util/utils.js performs path traversal checks only on the string representation of archive entry names, comparing against the resolved extraction root. However, Utils.writeFileTo uses fs.openSync(path, "w", 0o666) to open files for writing, which resolves symlinks and contains no O_NOFOLLOW flag or pre-write fs.lstatSync check. When an extraction path component is a symlink pointing outside the extraction root, the library follows that symlink and writes attacker-controlled content to the target file, then changes its permissions. The extraction functions affected are extractAllTo, extractAllToAsync, and extractEntryTo. Exploitation requires: (1) the attacker can create a symlink in the extraction directory (e.g., in /tmp or a CI workspace), (2) the extraction process has overwrite mode enabled (because fs.existsSync also resolves symlinks and would otherwise decline), and (3) the attacker has write permissions to the extraction directory. No patch version is currently available according to the advisory.

Affected products

  • cthackers adm-zip 0.5.9 through 0.6.0

Timeline

  • 2026-08-24: disclosed
  • 2026-08-24: advisory: GitHub Advisory Database and NVD published
  • 2026-09-08: other: GitHub advisory reviewed and updated

References

Related threats