Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snyk vulnerability [SNYK-JS-TAR-1579155] #50

Open
HHogg opened this issue Oct 29, 2021 · 0 comments
Open

Snyk vulnerability [SNYK-JS-TAR-1579155] #50

HHogg opened this issue Oct 29, 2021 · 0 comments
Labels
help wanted Extra attention is needed snyk-vulnerability

Comments

@HHogg
Copy link
Owner

HHogg commented Oct 29, 2021

Affecting Packages/Plugins

Overview

tar is a full-featured Tar for Node.js.

Affected versions of this package are vulnerable to Arbitrary File Write. node-tar aims to guarantee that any file whose location would be outside of the extraction target directory is not extracted. This is, in part, accomplished by sanitizing absolute paths of entries within the archive, skipping archive entries that contain .. path portions, and resolving the sanitized paths against the extraction target directory.

This logic is insufficient on Windows systems when extracting tar files that contain a path that is not an absolute path, but specify a drive letter different from the extraction target, such as C:some\path. If the drive letter does not match the extraction target, for example D:\extraction\dir, then the result of path.resolve(extractionDirectory, entryPath) resolves against the current working directory on the C: drive, rather than the extraction target directory.

Additionally, a .. portion of the path can occur immediately after the drive letter, such as C:../foo, and is not properly sanitized by the logic that checks for .. within the normalized and split portions of the path.

Note: This only affects users of node-tar on Windows systems.

Remediation

Upgrade tar to version 6.1.9, 5.0.10, 4.4.18 or higher.

References

@HHogg HHogg added help wanted Extra attention is needed snyk-vulnerability labels Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed snyk-vulnerability
Projects
None yet
Development

No branches or pull requests

1 participant