HeadlinesBriefing favicon HeadlinesBriefing.com

node-tar Vulnerability: CVE-2026-23745 Allows File Overwrite

DEV Community •
×

A critical path traversal vulnerability has been identified in the node-tar library, tracked as CVE-2026-23745. This flaw, with a CVSS score of 8.2, allows attackers to bypass extraction root restrictions. By manipulating hard links and symlinks, malicious actors can overwrite arbitrary system files. This could lead to a complete system compromise through a simple archive extraction.

Specifically, node-tar versions before 7.5.3 failed to properly sanitize the targets of hardlinks and symlinks. An attacker can craft a malicious archive containing links to absolute paths, like `/etc/passwd`. When extracted, these links would overwrite critical system files. This type of vulnerability is a common target for attackers, especially in CI/CD pipelines and server-side applications.

The fix involves stripping absolute paths from link targets, implemented in version 7.5.3. To mitigate risk, developers should upgrade node-tar to the patched version. They should also validate all archive entries for path traversal and run extraction processes with limited file system access. Regularly auditing and updating dependencies is also essential.

This vulnerability highlights the importance of secure coding practices and careful handling of external data. The impact is severe, potentially allowing for remote code execution or system takeover. Developers should use `npm audit` or `yarn audit` to identify vulnerable instances. The focus now is on patching affected systems and preventing exploitation.