node-forge 1.4.1 fixes AES-GCM check that accepts any ciphertext when tagLength converts to zero (CVE-2026-119186)
A GitHub advisory published Oct 30 covers an authentication bypass in the AES-GCM mode of node-forge, the widely used pure-JavaScript crypto library on npm.
- Bug:
start()stored thetagLengthoption without validation. A value that converts to 0 (0,null,false,'','0') made the tag truncation compute16 % 0 = NaNand empty the tag, sodecipher.finish()returnedtruefor any ciphertext and additional data. - Affected: node-forge 1.4.0 and earlier. Fixed: 1.4.1, where
start()throws unless the tag length is one NIST SP 800-38D allows (128, 120, 112, 104, 96, 64 or 32 bits). Missing ornulluses the 128-bit default. - Severity: medium, CVSS 5.9, because exploitation needs the application to pass an attacker-influenced or falsy
tagLength.
What to do: upgrade to 1.4.1 (check transitive dependencies with npm ls node-forge), and set tagLength explicitly rather than passing it through from config or user input.