CVE-2026-31808
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
5.3
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.
- Record
CVE-2026-31808- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Weakness
- CWE-835
- Updated
- 2026-11-02
EUVDEUVD-2026-10894
5.3
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.
- Record
EUVD-2026-10894- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-5v7r-6r5c-r473
5.3
file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header
Impact
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.
Patches
Fixed in version 21.3.1. Users should upgrade to >= 21.3.1.
Workarounds
Validate 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.
References
- Fix commit: 319abf871b50ba2fa221b4a7050059f1ae096f4f
Reporter
- Record
GHSA-5v7r-6r5c-r473- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Weakness
- CWE-835
- Updated
- 2026-11-02
NVD
5.3
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.
- Record
CVE-2026-31808- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Weakness
- CWE-835
- Updated
- 2026-11-02
OSV
5.3
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.
- Record
CVE-2026-31808- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Weakness
- CWE-835
- Updated
- 2026-11-02
OSVGHSA-5v7r-6r5c-r473
5.3
file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header
Impact
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.
Patches
Fixed in version 21.3.1. Users should upgrade to >= 21.3.1.
Workarounds
Validate 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.
References
- Fix commit: 319abf871b50ba2fa221b4a7050059f1ae096f4f
Reporter
- Record
GHSA-5v7r-6r5c-r473- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Weakness
- CWE-835
- Updated
- 2026-11-02
Show 4 moreShow less
OSVROOT-APP-NPM-CVE-2026-31808
5.3
CVE-2026-31808 in file-type - Patched by Root
Root has patched CVE-2026-31808 in the file-type package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2026-31808- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Updated
- 2026-11-02
OSVCLSA-2026-1781744121 No score
TuxCare security update for file-type (1 CVE)
TuxCare rebuilt file-type to address 1 CVE. Fixed in 17.1.6-tuxcare.1.
- Record
CLSA-2026-1781744121- Updated
- 2026-11-02
OSVCLSA-2026-1791199964 No score
TuxCare security update for file-type (1 CVE)
TuxCare rebuilt file-type to address 1 CVE. Fixed in 16.5.4-tuxcare.1.
- Record
CLSA-2026-1791199964- Updated
- 2026-11-02
OSVCLSA-2026-1793790371 No score
TuxCare security update for file-type (1 CVE)
TuxCare rebuilt file-type to address 1 CVE. Fixed in 10.11.0-tuxcare.1.
- Record
CLSA-2026-1793790371- Updated
- 2026-11-04
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
file-typenpm |
13.0.0 up to 21.3.1 | 21.3.1 |
file-typeTuxCare:npm |
17.1.6-tuxcare.0 up to 17.1.6-tuxcare.1, plus listed versions 17.1.6 |
17.1.6-tuxcare.1 |
file-typeTuxCare:npm |
16.5.4-tuxcare.0 up to 16.5.4-tuxcare.1, plus listed versions 16.5.4 |
16.5.4-tuxcare.1 |
file-typeTuxCare:npm |
10.11.0-tuxcare.0 up to 10.11.0-tuxcare.1, plus listed versions 10.11.0 |
10.11.0-tuxcare.1 |
file-typeRoot:npm |
before 21.0.0-aikido.3 | 21.0.0-aikido.320.4.1-aikido.216.5.4-aikido.120.5.0-aikido.121.1.0-aikido.121.1.1-aikido.116.5.4-aikido.2 |
@rootio/file-typeRoot:npm |
before 21.0.0-root.io.2 | 21.0.0-root.io.220.4.1-root.io.121.0.0-root.io.320.4.1-root.io.216.5.4-root.io.120.5.0-root.io.121.1.0-root.io.121.1.1-root.io.116.5.4-root.io.2 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, aliases, facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-31808 is a medium vulnerability (CVSS 5.3) in Sindresorhus File-type, published March 10, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.37%, the 30th percentile. Fixed in file-type 21.3.1.
References
github.com/sindresorhus/file-type/security/advisories/GHSA-5v7r-6r5c-r473
github.com/sindresorhus/file-type/commit/319abf871b50ba2fa221b4a7050059f1ae096f4f
nvd.nist.gov/vuln/detail/CVE-2026-31808
github.com/advisories/GHSA-5v7r-6r5c-r473
github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31808.json
github.com/sindresorhus/file-type