CVE-2022-36313 is a medium-severity (CVSS 5.5) CWE-835 vulnerability in file-type. A fix is available for file-type — see the affected versions and patch details below.
file-type vulnerable to Infinite Loop via malformed MKV file
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2022-36313.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
file-typenpmDescription
An issue was discovered in the file-type package from 13.0.0 until 16.5.4 and 17.x before 17.1.3 for Node.js. A malformed MKV file could cause the file type detector to get caught in an infinite loop. This would make the application become unresponsive and could be used to cause a DoS attack when used on a web server.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | file-type | ≥ 13.0.0&&< 16.5.4 | 16.5.4npm install file-type@16.5.4 |
| 📦npm | file-type | ≥ 17.0.0&&< 17.1.3 | 17.1.3npm install file-type@17.1.3 |
Affected Products
file-typesindresorhusDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for file-type, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update file-type to 16.5.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2022-36313 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Data Grid 8.4.1 | file-type | RHSA-2023:0713 |
Frequently Asked Questions
Is CVE-2022-36313 in your dependencies?
Find it across npm, including transitive dependencies.