mammoth is vulnerable to Path Traversal
59
Medium Risk
The command-line interface extracts embedded images to the directory given by --output-dir, deriving each filename's extension from the image content type taken from the document. On Windows a backslash in the content type subpart is treated as a path separator, so a crafted content type such as image/gif\..\ yields a filename that escapes the output directory. Converting an untrusted document can therefore write image files to locations outside the intended directory. The fix parses the extension by splitting on both forward slashes and backslashes so the content type can no longer alter the output path.
You are affected if you are using a version that falls within the vulnerable range and you use the command-line interface with the --output-dir option on Windows to convert untrusted documents.
mammoth is vulnerable to Path Traversal in versions 0.2.0 - 1.12.0.
Upgrade the mammoth 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