CVE-2026-31808: 
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-31808 is a denial-of-service vulnerability in the ASF (WMV/WMA) file type detection parser of the file-type npm package. A crafted input with an ASF sub-header size field of zero causes the parser to enter an infinite loop, stalling the Node.js event loop indefinitely. Affected versions are >= 13.0.0 and < 21.3.1; the fix was released in version 21.3.1. The vulnerability was published on March 9–10, 2026, and carries a CVSS v3.1 base score of 5.3 (Medium) (GitHub Advisory, Red Hat).

Technical details

The root cause is classified as CWE-835 (Loop with Unreachable Exit Condition / Infinite Loop). When the ASF parser processes a sub-header with a size field of zero, the computed payload value becomes -24 (i.e., 0 - 24). Passing this negative value to tokenizer.ignore(payload) moves the read position backwards rather than forwards, causing the same sub-header to be re-read in an endless loop. The fix (commit 319abf8) adds a safeguard that breaks the loop if tokenizer.position has not advanced past its previous value after each iteration. An attacker can trigger this condition remotely with a crafted 55-byte payload, requiring no authentication or user interaction (GitHub Advisory, Fix Commit).

Impact

Successful exploitation causes the Node.js event loop to stall indefinitely, rendering the affected application unresponsive and resulting in a denial of service. There is no impact on confidentiality or data integrity — the vulnerability is limited to availability. Any service that passes untrusted or attacker-controlled input to file-type for detection (e.g., file upload endpoints, media processing pipelines) is at risk of complete service disruption from a single 55-byte payload (GitHub Advisory).

Exploitability

No public proof-of-concept exploit code has been identified, and there is no evidence of in-the-wild exploitation at this time (GitHub Advisory). The EPSS score is approximately 0.031–0.044%, indicating a low near-term exploitation probability. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. No threat actor attribution has been reported.

Exploitation steps

  1. Identify target: Locate a web application or service that accepts file uploads or arbitrary binary input and uses the file-type npm package (versions 13.0.0–21.3.0) to detect file types.
  2. Craft malicious payload: Construct a 55-byte buffer that begins with the ASF magic bytes (30 26 B2 75 8E 66 CF 11 A6 D9 00 00 00 00 00 00) followed by a sub-header where the 8-byte size field is set to zero (e.g., 3026b2758e66cf11a6d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 in hex).
  3. Submit payload: Upload or POST the crafted buffer to the target endpoint that triggers file-type detection (e.g., a file upload API).
  4. Trigger infinite loop: The ASF parser reads the zero-size sub-header, computes payload = 0 - 24 = -24, and calls tokenizer.ignore(-24), moving the read position backwards. The parser re-reads the same sub-header forever, blocking the Node.js event loop.
  5. Achieve denial of service: The application becomes unresponsive to all subsequent requests for as long as the event loop remains stalled, effectively taking the service offline (GitHub Advisory, Fix Commit).

Indicators of compromise

  • Network: Repeated HTTP requests (POST/PUT) to file upload endpoints with small (~55-byte) payloads that begin with ASF magic bytes (30 26 B2 75 8E 66 CF 11 A6 D9).
  • Process: Node.js process CPU usage pegged at 100% with no corresponding throughput; event loop lag metrics spiking to extreme values or timing out.
  • Logs: Application logs showing requests to file-type detection endpoints that never complete or return a response; upstream timeout errors from load balancers or reverse proxies following such requests.
  • Application Behavior: Service becomes unresponsive to all requests after receiving a small binary upload; health check endpoints stop responding.

Mitigation and workarounds

The primary remediation is to upgrade file-type to version 21.3.1 or later, which includes a safeguard that breaks the ASF parsing loop if the tokenizer position does not advance (GitHub Advisory, Fix Commit). If immediate patching is not possible, the following workarounds are recommended:

  • Validate or limit the size of input buffers before passing them to file-type.
  • Run file type detection in a worker thread with a timeout so that an infinite loop does not block the main event loop.
  • Implement rate limiting and input validation on file upload endpoints to reject suspicious or malformed ASF files before processing.

IBM has issued advisories for affected products including Cloud Pak for Integration, Watsonx BI Assistant, IBM DevOps Solution Workbench, watsonx.data, IBM API Connect, and QRadar Suite Software (IBM CP4I Advisory, IBM API Connect).

Community reactions

The vulnerability was reported by crnkovic@lokvica.com and disclosed by the package maintainer (sindresorhus) via a GitHub Security Advisory on March 9, 2026. Red Hat tracked the issue via Bugzilla (Bug 2446309) and IBM issued multiple security bulletins for downstream products incorporating the affected file-type package. No significant broader media coverage or notable researcher commentary beyond vendor advisories has been identified (Red Hat Bugzilla, IBM CP4I Advisory).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

RHEL / CentOS

Affected

OpenShift

openshift-logging/elasticsearch-operator-bundle

Affected

Source: This report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-gvwc-5hr5-44p8HIGH7.5
  • JavaScript logoJavaScript
  • probe-image-size
NoYesOct 26, 2026
GHSA-5jh3-w3fj-6758LOW3.7
  • JavaScript logoJavaScript
  • probe-image-size
NoYesOct 26, 2026
GHSA-5v8x-rm7w-m4c7LOW3.7
  • JavaScript logoJavaScript
  • probe-image-size
NoYesOct 26, 2026
GHSA-7pqp-3q23-mwr8LOW3.7
  • JavaScript logoJavaScript
  • probe-image-size
NoYesOct 26, 2026
GHSA-3qg4-7mq2-gm93MEDIUMN/A
  • JavaScript logoJavaScript
  • probe-image-size
NoYesOct 26, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management