Executive summary
CVE-2026-140248 is a symlink-resolution path-traversal vulnerability in the node-tar archive library for Node.js. In affected releases, a crafted archive can establish a symbolic link inside the extraction directory and then add another symbolic link whose target passes through the first link before applying a parent-directory component. The extracted link appears to remain within the archive root, but its effective target can resolve outside that root.
The affected range is >= 7.5.22, < 8.0.0, with the flaw active when extraction uses the default preservePaths: false configuration. node-tar 8.0.0 contains the fix. The available intelligence assigns CVSS 4.0 score 7.2 (HIGH) and describes network reachability, but it reports no known exploitation, no CISA KEV entry, and no public proof of concept in the supplied material.
Affected systems
Applications are potentially exposed when they:
- use node-tar in the affected version range;
- extract attacker-controlled or otherwise untrusted tar archives;
- leave
preservePathsdisabled; and
- subsequently read, write, execute, copy, or otherwise follow files from the extraction directory.
Potential deployments include package-management services, CI and build pipelines, container-image tooling, artifact-processing systems, upload handlers, backup restoration workflows, and applications that unpack downloaded archives. A vulnerability scanner finding alone does not establish exploitability: the relevant exposure depends on whether untrusted archives reach the affected extraction path and whether later processing dereferences the planted symbolic link.
Vendored, forked, or internally mirrored copies of node-tar must be assessed independently. Upgrading the top-level application dependency may not remediate a vulnerable copy retained elsewhere in the dependency tree.
Technical analysis
The defect arises from a mismatch between lexical and filesystem path resolution.
node-tar's STRIPABSOLUTEPATH logic evaluates a symbolic-link target lexically. It does not account for the possibility that an earlier path component will itself be interpreted as a symbolic link by the operating system. The filesystem resolves paths component by component and can follow an intermediate symbolic link before applying a subsequent .. component.
A malicious archive can exploit the difference with two symbolic-link entries:
- The first entry creates a symbolic link inside the extraction root.
- The second entry has a relative target that traverses that first link and then includes a parent-directory component.
- Lexical normalization treats the second target as remaining within the extraction root, allowing the link to be created.
- When the operating system later resolves the second link, it follows the intermediate link and then processes the parent traversal, yielding a destination outside the extraction tree.
The immediate result is an escaping symbolic link, not automatically an arbitrary file write. Impact arises when a downstream consumer follows it. Depending on application behavior and operating-system permissions, that follow-on operation could disclose files, overwrite files, alter configuration, or influence a build or installation step.
The weakness is categorized as CWE-59: Improper Link Resolution Before File Access ('Link Following'). The supplied advisory also associates the issue with CAPEC-132 (Symlink Attack), CAPEC-17, CAPEC-35, and CAPEC-76.
Attack preconditions
The archive must contain a carefully ordered pair of symbolic links, and the victim must extract it through an affected node-tar configuration. Exploitation also needs a later operation that follows the escaping link. The attacker generally needs no special local privilege when they can submit or cause delivery of an archive to an exposed service.
Exposure and exploitation assessment
The practical attack surface can be broad across Node.js supply-chain and content-processing systems, but the supplied intelligence does not establish active exploitation. The advisory reports no exploitation evidence, no CISA KEV listing, and no identified public GitHub proof of concept. The severity rating therefore reflects the potential impact of a crafted archive rather than observed attack activity.
The combination of default configuration, low-complexity archive structure, and delayed impact is material: archive inspection that only checks the visible entry paths may miss the fact that a later dereference exits the intended directory.
Mitigation
The primary remediation is to upgrade node-tar to version 8.0.0 or later.
- Review dependency lockfiles, including
package-lock.json,pnpm-lock.yaml,yarn.lock, and npm shrinkwrap files, for node-tar versions in the affected range.
- Update direct and transitive dependencies to resolve to node-tar 8.0.0 or later. Use dependency overrides or resolutions where transitive version selection prevents the upgrade.
- Check vendored or forked copies and backport the upstream fix when an immediate major-version upgrade is not feasible.
- Rebuild and redeploy affected applications and workers, then confirm the runtime dependency tree actually contains the fixed release.
- Review extraction workflows that process uploads, dependencies, CI artifacts, backups, container layers, or downloaded archives.
- Consider rejecting archives that contain suspicious combinations of symbolic links and parent-directory components before extraction.
- Isolate extraction in a fresh directory running with minimal privileges, and prevent subsequent processing from following links that escape that directory.
Enabling preservePaths: true prevents the reported exploit path under the documented condition, but it permits path-preserving extraction behavior and should be limited to fully trusted archives. It is not equivalent to updating node-tar and can introduce separate risks.
For environments that cannot upgrade immediately, pre-validation of archive entries, extraction isolation, and controls that detect or prevent symlink traversal provide defense in depth. Filesystem features such as nosymfollow, where supported, may also reduce the risk of following symlinks, but support and behavior vary by operating system and mount configuration.
Detection and monitoring
Archive-processing systems can search for suspicious sequences consisting of an in-root symbolic link and a later symbolic-link target that traverses an earlier link and includes parent-directory components. Because legitimate archives may contain symbolic links, detection should combine entry ordering, target structure, and the application's trust model rather than rely on a single keyword.
Operational monitoring can focus on file access immediately after archive extraction, particularly paths that resolve outside the intended extraction root. File-integrity monitoring on sensitive configuration and credential locations may reveal writes that followed the malicious link. Dependency telemetry should also track the introduction of affected node-tar versions through transitive updates.
Expert insight
The important distinction in CVE-2026-140248 is between where a symbolic link is stored and where it resolves. Validating only the lexical form of a link target is insufficient when an archive can modify the filesystem state used to interpret that target. The vulnerable sequence creates an in-root link first and uses it as an indirection in the second link, converting apparently safe lexical normalization into a physical escape.
That delay also shapes incident response. Extraction can complete without an obvious error, while the consequential operation occurs later in a build script, package post-step, file copier, template loader, or service request. Evidence should therefore include archive entries, extraction logs, and the first downstream activity that dereferenced symbolic links.
Although the reported CVSS 4.0 score is HIGH, the available evidence supports treating this as a serious patch-priority vulnerability rather than evidence of an active exploitation campaign. The fixed release and upstream patch provide a direct remediation path, while dependency inventory and post-extraction link handling address the less visible transitive exposure.
Actionable recommendations
- Upgrade node-tar to 8.0.0 or later and regenerate dependency lockfiles.
- Search all application and service repositories for affected direct, transitive, vendored, and forked copies.
- Rebuild deployment artifacts after dependency updates and verify the resolved version at runtime.
- Prioritize services that extract untrusted archives or process untrusted dependencies, uploads, build inputs, backups, or container layers.
- Add archive pre-validation and reject suspicious symbolic-link combinations where operationally feasible.
- Extract into an isolated, minimally privileged directory and prevent downstream processing from following out-of-root links.
- Review post-extraction file access and file-integrity telemetry for evidence of escaped-link activity.
- Monitor the upstream advisory and release history for follow-up findings.