{"id":"GHSA-5v7r-6r5c-r473","revision":"96ffa2ad39554b27ba21f832ffeed06e","records":[{"revision":"96ffa2ad39554b27ba21f832ffeed06e","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-5v7r-6r5c-r473","aliases":["CVE-2026-31808"],"title":"file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header","description":"### Impact\nA 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.\n\nAny 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.\n\n### Patches\nFixed in version 21.3.1. Users should upgrade to >= 21.3.1.\n\n### Workarounds\nValidate or limit the size of input buffers before passing them to `file-type`, or run file type detection in a worker thread with a timeout.\n\n### References\n- Fix commit: 319abf871b50ba2fa221b4a7050059f1ae096f4f\n\n### Reporter\n\ncrnkovic@lokvica.com","state":0,"publishedAt":"2026-03-10T23:57:09+00:00","modifiedAt":"2026-09-10T03:50:37.6741879+00:00","affected":[{"ecosystem":"npm","name":"file-type","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"13.0.0"},{"kind":"fixed","version":"21.3.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/sindresorhus/file-type/security/advisories/GHSA-5v7r-6r5c-r473","https://nvd.nist.gov/vuln/detail/CVE-2026-31808","https://github.com/sindresorhus/file-type/commit/319abf871b50ba2fa221b4a7050059f1ae096f4f","https://github.com/sindresorhus/file-type"],"sourceUrl":"https://github.com/advisories/GHSA-5v7r-6r5c-r473","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-5v7r-6r5c-r473","identifiers":["GHSA-5v7r-6r5c-r473","CVE-2026-31808"]},"retained":false,"historicalAffected":[]}],"coverage":[]}