{"id":"CVE-2026-31808","published":"2026-03-10T21:01:55Z","modified":"2026-03-11T16:00:14Z","title":"file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header","vendor":"sindresorhus","product":"file-type","tier":"tail","description":{"text":"file-type detects the file type of a file, stream, or data. Prior to 21.3.1, a denial of service vulnerability exists in the ASF (WMV/WMA) file type detection parser. When parsing a crafted input where an ASF sub-header has a size field of zero, the parser enters an infinite loop. The payload value becomes negative (-24), causing tokenizer.ignore(payload) to move the read position backwards, so the same sub-header is read repeatedly forever. Any application that uses file-type to detect the type of untrusted/attacker-controlled input is affected. An attacker can stall the Node.js event loop with a 55-byte payload. Fixed in version 21.3.1.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.3,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00485,"percentile":0.34498,"provenance":"source"},"cwes":[{"id":"CWE-835","name":"Loop with Unreachable Exit Condition"}],"references":[{"url":"https://github.com/sindresorhus/file-type/security/advisories/GHSA-5v7r-6r5c-r473","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/sindresorhus/file-type/commit/319abf871b50ba2fa221b4a7050059f1ae096f4f","tags":["x_refsource_MISC"]}],"priority":{"score":10.6,"factors":[{"name":"EPSS percentile","points":6.9},{"name":"CVSS severity","points":3.71}]},"vendorSlug":"sindresorhus","affectedVersions":[{"vendor":"sindresorhus","product":"file-type","versions":[">= 13.0.0, < 21.3.1"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2026-03-11T15:53:37.941340Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"file-type","vulnerableRanges":[">=13.0.0, <21.3.1"],"patched":["21.3.1"],"from":["GHSA-5v7r-6r5c-r473"],"provenance":"source"}],"summary":{"text":"The file-type library's ASF (WMV/WMA) parser, which detects file types for files, streams, or data, contains a flaw in which a crafted input with an ASF sub-header whose size field is zero causes the parser to loop forever. An attacker who can supply untrusted input to an application that uses file-type for type detection can stall the Node.js event loop with a 55-byte payload, requiring only network access to the application and no authentication or user interaction.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:08:51Z"},"euvd":{"id":"EUVD-2026-10894","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-sindresorhus-file-type-cve-2022-36313","parents":[{"from":"CVE-2022-36313","to":"CVE-2026-31808","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["core.js","test.js"],"commits":["https://github.com/sindresorhus/file-type/commit/2c4d1200c99dffb7d515b9b9951ef43c22bf7e47","https://github.com/sindresorhus/file-type/commit/8f981c32e2750d2516457e305e502ee2ad715759","https://github.com/sindresorhus/file-type/commit/319abf871b50ba2fa221b4a7050059f1ae096f4f"],"basis":"shared function","functions":["FileTypeParser","test"]}]}],"children":[{"from":"CVE-2026-31808","to":"CVE-2026-32630","relation":"successor","confidence":"high","kind":"lineage","evidence":[{"kind":"version-step","provenance":"source","package":"npm:file-type","fromFixed":"21.3.1","toFixed":"21.3.2","daysApart":3},{"kind":"same-code","provenance":"machine","files":["core.js","test.js"],"commits":["https://github.com/sindresorhus/file-type/commit/319abf871b50ba2fa221b4a7050059f1ae096f4f","https://github.com/sindresorhus/file-type/commit/399b0f156063f5aeb1c124a7fd61028f3ea7c124","https://github.com/sindresorhus/file-type/commit/a155cd71323279de173c54e8c530d300d3854fdd"],"basis":"shared function","functions":["FileTypeParser","test"]}]}],"packageHistory":[{"cve":"CVE-2022-36313","published":"2022-07-21","fixed":"17.1.3","kev":false},{"cve":"CVE-2026-31808","published":"2026-03-10","fixed":"21.3.1","kev":false},{"cve":"CVE-2026-32630","published":"2026-03-13","fixed":"21.3.2","kev":false}],"package":"npm:file-type"}}