KEVWire

Security intelligence, with context.

Response snapshot Oct 31, 2026, 01:26 UTC

Back to the wire
Permalink
VulnerabilityCVE-2026-119186

Forge: AES-GCM authentication bypass via unvalidated tagLength option

The AES-GCM mode in forge.cipher does not validate the tagLength option passed to start(). With a tagLength of 0 or a value that converts to 0 (such as null, false, '' or '0'), the authentication tag is empty, and decipher.

At a glance

Exploited
Not known
Severity
5.9 Medium (CVSS 3.1)
Chance of exploitation
Not estimated
Sources
1 source

What to do

GitHub lists first patched versions: node-forge: 1.4.1. Confirm the affected range and upgrade guidance in the exact advisory.

Read GitHub-reviewed advisory GHSA-5cwg-6vw7-rj6p (opens a new tab)

What happened

Summary

The AES-GCM mode in forge.cipher does not validate the tagLength option passed to start(). With a tagLength of 0 or a value that converts to 0 (such as null, false, '' or '0'), the authentication tag is empty, and decipher.finish() returns true for any ciphertext and additional data when the supplied tag is empty or missing. Fixed in node-forge 1.4.1.

Details

modes.gcm.prototype.start() in lib/cipherModes.js stored the tagLength option without validation, and lib/cipher.js documented it as accepting "0-128". After processing the data, afterFinish() truncates the 16-byte tag with truncate(16 % (tagLength / 8)). For a tagLength that converts to 0, this is 16 % 0 = NaN, and truncating by NaN empties the tag.

Continue reading

On decryption, the start-time check that the supplied tag has tagLength / 8 bytes passes for an empty tag, and the final tag comparison compares two empty strings, so decipher.finish() returns true for any ciphertext and additional data.

NIST SP 800-38D section 5.2.1.2 allows only tag lengths of 128, 120, 112, 104 and 96 bits, plus 64 and 32 bits for certain applications.

The fix validates tagLength in start(), for both encryption and decryption. A missing, null or undefined tagLength uses the default of 128 bits. Any other value is converted with Number() and must be one of 128, 120, 112, 104, 96, 64 or 32; otherwise start() throws "Invalid tag length.". Numeric strings such as '128' are still accepted. With a validated tagLength, an empty tag no longer matches the expected tag length and is rejected.

Patches

Fixed in node-forge 1.4.1. cipher.start() now throws an error unless tagLength is one of the tag lengths allowed by NIST SP 800-38D (128, 120, 112, 104, 96, 64 or 32 bits); a null or undefined tagLength means the default of 128 bits.

Workarounds

Do not derive tagLength from received data. Pass a fixed tagLength (or omit it to use the default of 128 bits), and check that the received tag has the expected length before calling start(), for example if(tag.length !== 16) { throw new Error('Invalid tag.'); } before decipher.start({iv: iv, tag: tag});.

Proof of concept

Start an AES-GCM decipher with tagLength: 0 and an empty tag, as an application does when it derives the tag length from a received empty tag, and feed it arbitrary bytes that were never encrypted under the key:

var decipher = forge.cipher.createDecipher('AES-GCM', key);
decipher.start({iv: iv, tag: '', tagLength: 0});
decipher.update(forge.util.createBuffer('any attacker-chosen bytes'));
decipher.finish();
// <= 1.4.0: true
// 1.4.1: start() throws "Invalid tag length."

tagLength values null, false and '0' (with an empty tag), and tagLength: 0 with no tag option, give the same result on <= 1.4.0. The fix adds regression tests in tests/unit/aes.js.

Impact

Applications that decrypt AES-GCM data with forge.cipher.createDecipher() ('AES-GCM') and pass a zero-like tagLength are affected. Typical cases are a tag length derived from the received tag, or an unset configuration value:

var decipher = forge.cipher.createDecipher('AES-GCM', key);
decipher.start({iv: iv, tag: receivedTag, tagLength: receivedTag.length * 8});
decipher.update(forge.util.createBuffer(receivedCiphertext));
if(decipher.finish()) { /* attacker-supplied data accepted */ }

An attacker who can send a ciphertext with an empty tag to such an application can make it accept attacker-chosen ciphertext as authentic. Because GCM encryption is a stream cipher, an attacker who knows (part of) a captured message's plaintext can also change that plaintext to chosen values. The default (no tagLength option, 128 bits) and any fixed valid tagLength are not affected.

Affected package ranges reported by GitHub: node-forge: <= 1.4.0

Scores and how they were measured

CVSS base severity

5.9

Version 3.1As of

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N

Measurement source (opens a new tab)

How bad it is if exploited. Not a prediction of exploitation or proof you are exposed.

EPSS probability

Not available

A model's estimate of exploitation in the next 30 days, not certainty or your own risk.

Related technology

Sources

  1. Primary source

    GitHub-reviewed advisory GHSA-5cwg-6vw7-rj6p (opens a new tab)

    The public advisory supplies the description, affected package/version ranges, and any listed CVSS metric. GitHub review is not local review.

    Published Checked

  2. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-5cwg-6vw7-rj6p, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

Cite this record

For factual claims, cite the primary sources above; cite KEVWire for its compilation, dates, and classifications.

APA

KEVWire. (2026, October 30). Forge: AES-GCM authentication bypass via unvalidated tagLength option (CVE-2026-119186). https://kevwire.com/record/CVE-2026-119186

MLA

"Forge: AES-GCM authentication bypass via unvalidated tagLength option (CVE-2026-119186)." KEVWire, 30 Oct. 2026, kevwire.com/record/CVE-2026-119186.

Chicago

KEVWire. "Forge: AES-GCM authentication bypass via unvalidated tagLength option (CVE-2026-119186)." Last modified October 30, 2026. https://kevwire.com/record/CVE-2026-119186.

Evidence summary (plain text)

Forge: AES-GCM authentication bypass via unvalidated tagLength option (Oct 30, 2026).
The AES-GCM mode in forge.cipher does not validate the tagLength option passed to start(). With a tagLength of 0 or a value that converts to 0 (such as null, false, '' or '0'), the authentication tag is empty, and decipher.finish() returns true for any ciphertext and additional data when the supplied tag is empty or missing. Fixed in node-forge 1.4.1.

modes.gcm.prototype.start() in lib/cipherModes.js stored the tagLength option without validation, and lib/cipher.js documented it as accepting "0-128".
CVSS 5.9 (version 3.1; evidence as of Oct 30, 2026; https://github.com/advisories/GHSA-5cwg-6vw7-rj6p).
Sources:
GitHub-reviewed advisory GHSA-5cwg-6vw7-rj6p: https://github.com/advisories/GHSA-5cwg-6vw7-rj6p
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc
Record ID: CVE-2026-119186.
Record origin: Ingested record.
AI evidence: Not assessed.
Known exploitation: Not assessed.
Zero-day status: Not assessed. KEV membership alone does not establish zero-day status.
About this data

This record was ingested from a data source. Retrieved: Oct 31, 2026, 00:50 UTC. Ingestion is not an independent editorial investigation.

A CISA KEV listing documents known exploitation, not necessarily a zero-day; absence from the catalog does not prove a vulnerability has never been exploited.

Technology tags indicate possible relevance, not verified exposure. Confirm the affected product, version, and configuration against your own inventory; KEVWire does not scan your systems.

A personal reading checklist on this device, not verified remediation.

Record JSON

Your account

Email alerts

Email alerts are coming as part of KEVWire Premium: join the waitlist. To follow your stack today, use its RSS feed, which honors your filters, or connect an AI agent through the API.

Suggest an improvement

Ideas, missing sources, corrections, and bugs are all welcome. No account needed. Suggestions are reviewed by a person before anything changes.

Record details

Record detail