CVE-2026-54156: node-opcua Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-6wvw-vrw4-363w
CVSS 7.5
CWE-770
Published
Advisory Summary

CVE-2026-54156 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting node-opcua libraries in the npm ecosystem. The issue involves unbounded nonce cache enables unauthenticated heap exhaustion dos. Remediation is available by upgrading affected packages to version 2.166.0.

CVE-2026-54156 at a Glance

CVE Identifier CVE-2026-54156
GHSA Identifier GHSA-6wvw-vrw4-363w
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product node-opcua
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-54156

To remediate this vulnerability, upgrade all affected node-opcua dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

node-opcua fixed: 2.166.0
npm install node-opcua@2.166.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls node-opcua

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-54156, inspect your project dependencies using npm:

npm ls node-opcua

Analyze the terminal output to locate any version of node-opcua in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.166.0), your application is affected.

Note: The npm ls node-opcua command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-770: Allocation of Resources Without Limits or Throttling, where 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. In node-opcua, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

**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

CVE-2026-54156 Affected node-opcua Versions

1 component(s)
Fixed Versions:
2.166.0
Product / Package Ecosystem Affected Versions Fixed Version
node-opcua
npm
< 2.166.0
2.166.0

References

Frequently Asked Questions

What is CVE-2026-54156?
CVE-2026-54156 is a security vulnerability in node-opcua involving Unbounded nonce cache enables unauthenticated heap exhaustion DoS under CWE-770: Allocation of Resources Without Limits or Throttling.
Which node-opcua versions are affected?
Affected versions include releases prior to 2.166.0 across affected packages: node-opcua.
What version fixes CVE-2026-54156?
Upgrading to 2.166.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is node-opcua affected?
Yes, node-opcua is affected in releases prior to 2.166.0. Upgrade your dependency to 2.166.0 or later.
What is the CVSS score of CVE-2026-54156?
CVE-2026-54156 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-54156?
CVE-2026-54156 is classified under CWE-770: 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.).
How can I check npm dependencies for CVE-2026-54156?
Run the dependency tree command: 'npm ls node-opcua'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6wvw-vrw4-363w",
  "modified" : "2026-08-27T19:04:40Z",
  "published" : "2026-08-20T18:35:41Z",
  "aliases" : [ "CVE-2026-54156" ],
  "summary" : "node-opcua: Unbounded nonce cache enables unauthenticated heap exhaustion DoS",
  "details" : "**Summary**\nA 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.\n\n**Affected versions:** <= 2.165.0\n**Tested version:** 2.165.0\n**CVSS Score:** 7.5 (High)\n**CVSS Vector:** CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H\n**CWE:** CWE-770 Allocation of Resources Without Limits or Throttling\n\n---\n\n**Root Cause**\n\nIn `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.\n\nAn 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.\n\n---\n\n**Measured Impact**\n\nDynamically confirmed heap growth:\n- 5,000 unique nonces → +1.23 MB resident heap, no eviction after explicit GC\n- Projected: 10^6 nonces → ~246 MB resident heap\n- Achievable OOM on default Node.js heap limits\n\n---\n\n**Suggested Fix**\n\nAdd 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.\n\n---\n\nI 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.\n\nReporter: Stanley Tobias\nDiscovery date: 2026-03-23",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "node-opcua"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.166.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/node-opcua/node-opcua/security/advisories/GHSA-6wvw-vrw4-363w"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/node-opcua/node-opcua/commit/b82c2939fe9c658de58da993f2798ec5481d7313"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/node-opcua/node-opcua"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/node-opcua/node-opcua/releases/tag/v2.166.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-20T18:35:41Z",
    "nvd_published_at" : null
  }
}