Executive brief
The 'decompress' library, a popular tool for extracting archive files in JavaScript environments, is vulnerable to a security flaw that allows attackers to write files to unauthorized locations on a server. By providing a specially crafted ZIP file, an attacker can bypass security checks to overwrite system files or plant malicious code. This could lead to a full system takeover or significant operational disruption.
Technical details
A Zip Slip vulnerability exists in the 'decompress' library due to an issue with microtask processing order during archive extraction. When a ZIP archive contains two entries with the same path—the first being a symbolic link and the second a regular file—the library fails to resolve the symlink correctly before processing the second entry. This allows the file content to be written through the symlink to a target location outside the intended output directory. This flaw bypasses existing path traversal protections like 'preventWritingThroughSymlink'. An attacker can achieve arbitrary file writes and potentially remote code execution (RCE) by tricking the library into extracting a malicious archive. No patch is currently available for version 4.2.1.
Affected products
- npm decompress <= 4.2.1
Timeline
- 2026-06-05: disclosed
- 2026-06-05: advisory
References
- https://api.github.com/users/alessandro-mizzaro-sonarsource
- https://github.com/alessandro-mizzaro-sonarsource
- https://api.github.com/users/alessandro-mizzaro-sonarsource/gists%7B/gist_id%7D
- https://api.github.com/users/alessandro-mizzaro-sonarsource/repos
- https://avatars.githubusercontent.com/u/239119269?v=4
- https://api.github.com/users/alessandro-mizzaro-sonarsource/events%7B/privacy%7D