CVE-2026-54155: Node opcua Node-opcua Missing Nonce Verification Vulnerability

HIGH
Advisory Identifier: GHSA-mq36-523m-x7vv
CVSS 7.7
CWE-347
Published
Advisory Summary

CVE-2026-54155 is a HIGH (CVSS 7.7) node-opcua missing nonce verification vulnerability (CWE-347: Improper Verification of Cryptographic Signature) affecting Node opcua libraries in the npm ecosystem. The issue involves node-opcua missing nonce verification in usernameidentitytoken authentication. Remediation is available in the latest vendor maintenance releases.

CVE-2026-54155 at a Glance

CVE Identifier CVE-2026-54155
GHSA Identifier GHSA-mq36-523m-x7vv
Severity HIGH
CVSS v3.1 Base Score 7.7
CWE Classification CWE-347: Improper Verification of Cryptographic Signature
Affected Product Node opcua
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.7

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

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

How to Fix CVE-2026-54155

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: Latest secure release
npm install node-opcua@Latest secure release
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-54155, 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 the patched release), 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-347: Improper Verification of Cryptographic Signature, where the product does not verify, or incorrectly verifies, the cryptographic signature for data. 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 missing nonce verification in the UserNameIdentityToken authentication handler allows an unauthenticated remote attacker to forge a password token that extracts as an empty string, and to replay captured authentication tokens across sessions. **Affected versions:** <= 2.165.0 **Tested version:** 2.165.0 **CVSS Score:** 8.1 (High) **CVSS Vector:** CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L **CWE:** CWE-347 Improper Verification of Cryptographic Signature --- **Root Cause** In `packages/node-opcua-server/source/opcua_server.ts` at line 1886-1887, after RSA-OAEP decrypting the UserNameIdentityToken password blob, the server reads a 4-byte little-endian length field and extracts `buff[4 : 4+length]` as the password. It never verifies that the trailing bytes equal `session.nonce`. This has two consequences: 1. **Forged empty password:** An attacker who retrieves the server's public key via an unauthenticated `GetEndpoints` call can craft a token where the 4-byte length field equals `serverNonce.length` (32). The server computes `length = 32 - 32 = 0` and calls `isValidUser(username, "")`. Any account that accepts an empty password is compromised. 2. **Unconditional replay attack:** Because nonce binding is structurally absent, any captured UserNameIdentityToken ciphertext can be replayed in a different session unconditionally. The impact is compounded by a second issue: when the channel uses `SecurityMode=None`, `verifyClientSignature` returns `true` unconditionally (security_policy.ts:697-700), bypassing the channel-level signature check entirely. --- **Proof of Concept (logic, no exploit code)** ``` 1. GetEndpoints (unauthenticated) → retrieve server public key and RSA token policy 2. OpenSecureChannel (SecurityMode=None) 3. CreateSession 4. Craft plaintext: [0x20, 0x00, 0x00, 0x00] (readUInt32LE = 32 = serverNonce.length) 5. RSA-OAEP encrypt with server public key → 256-byte ciphertext 6. ActivateSession with crafted UserNameIdentityToken 7. Server decrypts → length = 32 - 32 = 0 → password = "" 8. isValidUser(username, "") is called ``` Dynamically confirmed: decryption produces `password = ""` with no error and no nonce verification. --- **Suggested Fix** After decrypting the password blob, verify that `buff.slice(4 + passwordLength)` equals `session.nonce` before extracting the password. Reject the token if verification fails. --- 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-54155 Affected Node opcua Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
node-opcua
npm
≤ 2.165.0

References

Frequently Asked Questions

What is CVE-2026-54155?
CVE-2026-54155 is a security vulnerability in Node opcua involving node-opcua missing nonce verification in UserNameIdentityToken authentication under CWE-347: Improper Verification of Cryptographic Signature.
Which Node opcua versions are affected?
Affected versions include releases prior to current release patches across affected packages: node-opcua.
What version fixes CVE-2026-54155?
Upgrading to current release patches (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 Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-54155?
CVE-2026-54155 has a CVSS v3.1 base score of 7.7 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L.
What CWE is associated with CVE-2026-54155?
CVE-2026-54155 is classified under CWE-347: Improper Verification of Cryptographic Signature (The product does not verify, or incorrectly verifies, the cryptographic signature for data.).
How can I check npm dependencies for CVE-2026-54155?
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-mq36-523m-x7vv",
  "modified" : "2026-08-20T18:35:33Z",
  "published" : "2026-08-20T18:35:33Z",
  "aliases" : [ "CVE-2026-54155" ],
  "summary" : "node-opcua missing nonce verification in UserNameIdentityToken authentication",
  "details" : "**Summary**\nA missing nonce verification in the UserNameIdentityToken authentication handler allows an unauthenticated remote attacker to forge a password token that extracts as an empty string, and to replay captured authentication tokens across sessions.\n\n**Affected versions:** <= 2.165.0\n**Tested version:** 2.165.0\n**CVSS Score:** 8.1 (High)\n**CVSS Vector:** CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L\n**CWE:** CWE-347 Improper Verification of Cryptographic Signature\n\n---\n\n**Root Cause**\n\nIn `packages/node-opcua-server/source/opcua_server.ts` at line 1886-1887, after RSA-OAEP decrypting the UserNameIdentityToken password blob, the server reads a 4-byte little-endian length field and extracts `buff[4 : 4+length]` as the password. It never verifies that the trailing bytes equal `session.nonce`.\n\nThis has two consequences:\n\n1. **Forged empty password:** An attacker who retrieves the server's public key via an unauthenticated `GetEndpoints` call can craft a token where the 4-byte length field equals `serverNonce.length` (32). The server computes `length = 32 - 32 = 0` and calls `isValidUser(username, \"\")`. Any account that accepts an empty password is compromised.\n\n2. **Unconditional replay attack:** Because nonce binding is structurally absent, any captured UserNameIdentityToken ciphertext can be replayed in a different session unconditionally.\n\nThe impact is compounded by a second issue: when the channel uses `SecurityMode=None`, `verifyClientSignature` returns `true` unconditionally (security_policy.ts:697-700), bypassing the channel-level signature check entirely.\n\n---\n\n**Proof of Concept (logic, no exploit code)**\n\n```\n1. GetEndpoints (unauthenticated) → retrieve server public key and RSA token policy\n2. OpenSecureChannel (SecurityMode=None)\n3. CreateSession\n4. Craft plaintext: [0x20, 0x00, 0x00, 0x00]  (readUInt32LE = 32 = serverNonce.length)\n5. RSA-OAEP encrypt with server public key → 256-byte ciphertext\n6. ActivateSession with crafted UserNameIdentityToken\n7. Server decrypts → length = 32 - 32 = 0 → password = \"\"\n8. isValidUser(username, \"\") is called\n```\n\nDynamically confirmed: decryption produces `password = \"\"` with no error and no nonce verification.\n\n---\n\n**Suggested Fix**\n\nAfter decrypting the password blob, verify that `buff.slice(4 + passwordLength)` equals `session.nonce` before extracting the password. Reject the token if verification fails.\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:H/PR:N/UI:N/S:U/C:H/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "node-opcua"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.165.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/node-opcua/node-opcua/security/advisories/GHSA-mq36-523m-x7vv"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/node-opcua/node-opcua"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-347" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-20T18:35:33Z",
    "nvd_published_at" : null
  }
}