GHSA-6wvw-vrw4-363w: 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. Configuration

    Add a TTL-based eviction policy to the process-global nonce cache `g_alreadyUsedNonce` so nonce entries are expired/removed after the maximum session timeout (or a reasonable fixed window), preventing indefinite growth and heap exhaustion.

    packages/node-opcua-secure-channel (server_secure_channel_layer.ts) g_alreadyUsedNonce = TTL-based eviction after reasonable fixed window / maximum session timeout

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

Does limiting maxSessions prevent this denial of service?

No. Although maxSessions=10 limits concurrent sessions, nonce entries remain after sessions expire, so repeated connection cycles can still accumulate entries indefinitely.

2

What access does an attacker need?

An attacker only needs network access to the node-opcua server. The CreateSession path does not require a certificate, authentication, or user interaction.

3

How can active exploitation or exposure manifest?

The server process's resident heap grows as unique nonces accumulate and can eventually crash. Testing measured approximately 1.23 MB of additional resident heap after 5,000 unique nonces.

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