Skip to main content
VulnerabilityPublished

CVE-2026-31808: sindresorhus file-type · Infinite Loop

Affects sindresorhus file-typeSource CVE Database V5

0
Compare

Not known to be exploited · CVSS 5.3 Medium : upgrade to 21.3.1 when convenient.

Data as of 29 Oct 2026, 19:04 UTC

CVSS 3.1 base score
5.3Medium
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.3% chance of exploitation in 30 days – higher than 27% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 21.3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 10 Mar 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 29 Oct 2026.

What to do

Upgrade sindresorhus file-type to 21.3.1.

Affected software

ProductAffectedFixed in
sindresorhusfile-typeAffected
  • >=13.0.0 <21.3.1
Fixed in
  • 21.3.1

AI-suggested

To mitigate this vulnerability, organizations should upgrade the sindresorhus file-type library to version 21.3.1 or later, where the infinite loop issue is fixed. For environments where immediate upgrade is not feasible, implementing input validation to detect and reject malformed ASF files with zero-sized sub-headers can help reduce risk. Additionally, applying timeouts or watchdog mechanisms on file processing routines can prevent indefinite blocking of the Node.js event loop. Employing sandboxing or resource limiting for file parsing operations can also contain the impact of potential infinite loops. Monitoring application logs for repeated parsing failures or unusually long processing times may help detect exploitation attempts. Finally, restricting exposure of file-type detection services to trusted sources or behind authentication can reduce attack surface.

Description

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.

References

Community reviews

Loading reviews…