Skip to content

node-opcua: Unbounded nonce cache enables unauthenticated heap exhaustion DoS

High severity GitHub Reviewed Published Jul 3, 2026 in node-opcua/node-opcua • Updated Aug 20, 2026

Package

npm node-opcua (npm)

Affected versions

<= 2.165.0

Patched versions

2.168.0

Description

Summary
A process-global nonce cache with no eviction policy allows an unauthenticated remote attacker to exhaust server heap memory by repeatedly opening sessions, causing the node-opcua server process to crash.

Affected versions: <= 2.165.0
Tested version: 2.165.0
CVSS Score: 7.5 (High)
CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CWE: CWE-770 Allocation of Resources Without Limits or Throttling


Root Cause

In packages/node-opcua-secure-channel/source/server/server_secure_channel_layer.ts at line 156, g_alreadyUsedNonce is a process-global object used to track previously seen nonces for replay detection. Entries are added on every OpenSecureChannelRequest and every CreateSession request but are never removed or expired.

An unauthenticated attacker can exploit the CreateSession path (which requires no certificate) to accumulate nonce entries indefinitely. Even with maxSessions=10 limiting concurrent sessions, nonces persist after session expiry, allowing slow but reliable heap exhaustion across repeated connection cycles.


Measured Impact

Dynamically confirmed heap growth:

  • 5,000 unique nonces → +1.23 MB resident heap, no eviction after explicit GC
  • Projected: 10^6 nonces → ~246 MB resident heap
  • Achievable OOM on default Node.js heap limits

Suggested Fix

Add a TTL-based eviction policy to g_alreadyUsedNonce. Nonces should be expired after the maximum session timeout (or a reasonable fixed window, e.g. 1 hour). A Map with timestamp entries and periodic cleanup is sufficient.


I am following a 90-day responsible disclosure policy. I am happy to provide additional technical details under embargo. Please confirm receipt at your earliest convenience.

Reporter: Stanley Tobias
Discovery date: 2026-03-23

References

@erossignon erossignon published to node-opcua/node-opcua Jul 3, 2026
Published to the GitHub Advisory Database Aug 20, 2026
Reviewed Aug 20, 2026
Last updated Aug 20, 2026

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

EPSS score

Weaknesses

Allocation of Resources Without Limits or Throttling

The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. Learn more on MITRE.

CVE ID

CVE-2026-54156

GHSA ID

GHSA-6wvw-vrw4-363w

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.