file-type is vulnerable to Denial of Service (DoS)
53
Medium Risk
When parsing streams of unknown size, the parser used larger read/skip limits (e.g. 16MB) for EBML, PNG, ASF, TIFF, and ZIP entry handling, and the ID3 probe only bounded each header size, not the cumulative read across repeated ID3 frames. An attacker can supply a crafted file or stream that triggers excessive reads or skips, causing high memory or CPU use and denial of service. The fix introduces a stricter budget for unknown-size payload probing (1MB), enforces a cumulative bound for ID3 probing (tokenizer.position + id3HeaderLength), and tightens ZIP scan budget and PNG/ASF/TIFF limits.
You are affected if you are using a version that falls within the vulnerable range.
file-type is vulnerable to Denial of Service (DoS) in versions 17.0.0 - 21.3.2.
Upgrade the file-type 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.

SOC 2Compliant
ISO 27001Compliant