file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-31808
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 7 Nov 2026, 03:43 UTC · Revision 1
Source evidence
file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header
core-osv · Original sourcePublished 10 Mar 2026, 21:01 UTC
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.
osv:CVE-2026-31808
Complete source record
{
"id": "571cb145fd8d43116b3274f956f79f7fd74cdb02d6a893af85177f06ed00d4d0",
"url": "https://osv.dev/vulnerability/CVE-2026-31808",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header",
"summary": "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.",
"evidence": "osv:CVE-2026-31808",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2026-31808",
"aliases": [
"CVE-2026-31808",
"GHSA-5v7r-6r5c-r473"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/sindresorhus/file-type",
"type": "GIT",
"events": [
{
"introduced": "9e910d8a95e883271b4ef77feaa225dcc21d9782"
},
{
"fixed": "ad5857e5384874e853cc9c4c29b867f1135a7c30"
},
{
"fixed": "319abf871b50ba2fa221b4a7050059f1ae096f4f"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:sindresorhus:file-type:*:*:*:*:*:node.js:*:*",
"range": [
{
"introduced": "13.0.0"
},
{
"fixed": "21.3.1"
}
],
"source": "CPE_RANGE"
},
{
"range": [
{
"fixed": "319abf871b50ba2fa221b4a7050059f1ae096f4f"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"versions": [
"v21.3.0",
"v21.2.0",
"v21.1.1",
"v21.1.0",
"v21.0.0",
"v20.5.0",
"v20.4.1",
"v20.4.0",
"v20.3.0",
"v20.2.0",
"v20.1.0",
"v20.0.1",
"v20.0.0",
"v19.6.0",
"v19.5.0",
"v19.4.1",
"v19.4.0",
"v19.3.0",
"v19.2.0",
"v19.1.1",
"v19.1.0",
"v19.0.0",
"v18.7.0",
"v18.6.0",
"v18.5.0",
"v18.4.0",
"v18.3.0",
"v18.2.1",
"v18.2.0",
"v18.1.0",
"v18.0.0",
"v17.1.6",
"v17.1.5",
"v17.1.4",
"v17.1.3",
"v17.1.2",
"v17.1.1",
"v17.1.0",
"v17.0.2",
"v17.0.1",
"v17.0.0",
"v16.5.1",
"v16.5.0",
"v16.4.0",
"v16.3.0",
"v16.2.0",
"v16.1.0",
"v16.0.1",
"v16.0.0",
"v15.0.1",
"v15.0.0",
"v14.7.1",
"v14.7.0",
"v14.6.2",
"v14.6.1",
"v14.6.0",
"v14.5.0",
"v14.4.0",
"v14.3.0",
"v14.2.0",
"v14.1.4",
"v14.1.3",
"v14.1.2",
"v14.1.1",
"v14.1.0",
"v14.0.0",
"v13.1.2",
"v13.1.1",
"v13.1.0",
"v13.0.3",
"v13.0.2",
"v13.0.1",
"v13.0.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-31808.json"
}
}
],
"modified": "2026-10-28T02:30:49.698453613Z",
"provider": "osv",
"references": [
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31808.json",
"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"
],
"provider_metadata": {
"cwe_ids": [
"CWE-835"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31808.json"
}
},
"related_cves": [
{
"value": "CVE-2026-31808",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 517848,
"published_at": "2026-03-10T21:01:55.466+00:00"
}