tarsafe is vulnerable to Path Traversal
81
High Risk
TarSafe.extractall() and TarSafe.extract() validate archive members by comparing the resolved member path against the extraction root with a plain string prefix comparison instead of a real path-boundary check. A member whose resolved path merely starts with the same characters as the root, such as a sibling directory, passes the check and is written outside the intended directory. On Windows a pre-filter keyed on the host path separator never runs the containment check for members that use the POSIX-style names required by the tar format, so absolute or drive-relative member names escape as well. Because the library is a drop-in safe replacement used specifically to extract untrusted archives, a crafted archive can write files outside the extraction directory; the fix replaces the prefix comparison with a true path-containment check anchored to the directory actually being extracted into.
You are affected if you are using a version that falls within the vulnerable range and you use it to extract untrusted or externally supplied tar archives.
tarsafe is vulnerable to Path Traversal in versions 0.0.1 - 0.0.5.
Upgrade the tarsafe library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant