CVE-2026-54156: High severity npm/node-opcua vulnerability

Published Aug 20, 2026
·
Updated

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/serversecurechannellayer.ts at line 156, galreadyUsedNonce 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 galreadyUsedNonce. 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

Affected Software

1 affected componentFixes available
npm/node-opcua<=2.165.0
2.168.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/node-opcua to a version that resolves this vulnerability.

    Fixed in 2.168.0
  2. Upgrade

    Upgrade node-opcua (node-opcua-secure-channel) to a version that resolves this vulnerability.

    Fixed in 2.165.0
  3. Configuration

    In packages/node-opcua-secure-channel/source/server/server_secure_channel_layer.ts (line ~156), replace the process-global g_alreadyUsedNonce nonce cache (currently no eviction/expiration) with a TTL-based eviction policy so nonce entries expire after the maximum session timeout or a reasonable fixed window; ensure entries are removed/expired rather than persisting indefinitely.

    node-opcua-secure-channel g_alreadyUsedNonce (nonce cache) = TTL-based eviction policy

Event History

Aug 20, 2026
Advisory Published
via GitHub·06:35 PM
Data Sourced
via GitHub·06:35 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Who can exploit this issue?

Any unauthenticated remote attacker able to connect to a node-opcua server can exploit the CreateSession path. No credentials, certificate, or user interaction are required.

2

Does limiting the number of concurrent sessions prevent exploitation?

No. A maxSessions setting such as maxSessions=10 limits concurrent sessions, but nonce entries remain after sessions expire. An attacker can repeat connection cycles over time to continue consuming heap memory.

3

What versions are affected?

node-opcua versions 2.165.0 and earlier are affected. The issue was tested and dynamically confirmed in version 2.165.0.

4

How can I tell whether a server is under attack or affected?

Monitor the node-opcua server process for sustained resident heap growth associated with repeated OpenSecureChannelRequest or CreateSession activity. The documented measurement showed approximately 1.23 MB of resident heap growth after 5,000 unique nonces.

5

What is the impact if exploitation succeeds?

Repeated requests can exhaust process heap memory and crash the node-opcua server process, causing a denial of service. The vulnerability affects availability; no confidentiality or integrity impact is stated.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203