Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. node-opcua
  4. ›
  5. CVE-2026-54156

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

August 20, 2026 (updated August 27, 2026)

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

  • github.com/advisories/GHSA-6wvw-vrw4-363w
  • github.com/node-opcua/node-opcua/commit/b82c2939fe9c658de58da993f2798ec5481d7313
  • github.com/node-opcua/node-opcua/releases/tag/v2.166.0
  • github.com/node-opcua/node-opcua/security/advisories/GHSA-6wvw-vrw4-363w
  • nvd.nist.gov/vuln/detail/CVE-2026-54156

Code Behaviors & Features

Detect and mitigate CVE-2026-54156 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 2.166.0

Fixed versions

  • 2.166.0

Solution

Upgrade to version 2.166.0 or above.

Impact 7.5 HIGH

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

Learn more about CVSS

Weakness

  • CWE-770: Allocation of Resources Without Limits or Throttling

Source file

npm/node-opcua/CVE-2026-54156.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Thu, 17 Sep 2026 00:18:47 +0000.