Off-by-one Error Affecting yauzl package, versions >=3.2.0 <3.2.1


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-YAUZL-15467445
  • published12 Mar 2026
  • disclosed12 Mar 2026
  • creditCodeAnt AI Code Reviewer

Introduced: 12 Mar 2026

NewCVE-2026-31988  (opens in a new tab)
CWE-193  (opens in a new tab)

How to fix?

Upgrade yauzl to version 3.2.1 or higher.

Overview

Affected versions of this package are vulnerable to Off-by-one Error via the entry.getLastModDate() function. An attacker can cause the process or the Node.js server to crash by submitting a malicious zip file containing a malformed NTFS extra field.

PoC

// Direct demonstration of the buffer OOB read
const data = Buffer.alloc(4);  // NTFS extra field with 4 bytes of data
let cursor = 4;

while (cursor < data.length + 4) {         // cursor reaches 4 = data.length
  const tag = data.readUInt16LE(cursor);   // THROWS: offset 4 out of range [0, 2]
  cursor += 2;
  const size = data.readUInt16LE(cursor);
  cursor += 2;
}

CVSS Base Scores

version 4.0
version 3.1