node-opcua: Namespace-Level RBAC Fail-Open - Anonymous Write/Call Bypass via Unbound `DefaultRolePermissions
CVE-2026-95860 · GHSA-xggf-m53x-jc3f · EUVD-2026-116210 · published 3 Nov 2026
How serious is it
- Severity: critical, CVSS score 9.1 out of 10.
- No exploit prediction (EPSS) score yet.
- Not on the CISA list of exploited vulnerabilities.
- No public exploit in Exploit-DB.
Is your app affected by CVE-2026-95860?
Paste this prompt into Claude Code, Cursor or any AI coding tool: it runs a free Shippable scan of your project and fixes what it finds. Built with Lovable, Bolt or v0? Scan your live app. Or upload your package file.
Who is affected
node-opcua(npm) >= 2.42.0, < 2.180.0node-opcua-address-space(npm) >= 2.42.0, < 2.180.0node-opcua-server(npm) >= 2.42.0, < 2.180.0
How to check
- Run
npm ls node-opcuain your project to see the installed version, including copies pulled in by other packages. - Run
npm ls node-opcua-address-spacein your project to see the installed version, including copies pulled in by other packages. - Run
npm ls node-opcua-serverin your project to see the installed version, including copies pulled in by other packages. - Or paste your lockfile into the checker: it lists every package with a known vulnerability, this one included.
- Or run
npx shippable-dev scan localhost:3000in your project folder. It reads your lockfile and flags this vulnerability along with every other known one.
How to fix
Copies a prompt for Claude Code, Cursor or Codex: it checks your lockfiles for this and upgrades it.
- On >= 2.42.0, < 2.180.0: Upgrade
node-opcuato 2.180.0 or later, commit the lockfile and redeploy. - On >= 2.42.0, < 2.180.0: Upgrade
node-opcua-address-spaceto 2.180.0 or later, commit the lockfile and redeploy. - On >= 2.42.0, < 2.180.0: Upgrade
node-opcua-serverto 2.180.0 or later, commit the lockfile and redeploy. - If a vulnerable version was live, check your logs and rotate the secrets that server could read.
The advisory
## Summary
An unauthenticated (**Anonymous**) client can **Write** protected Variables and **Call** privileged Methods on any Node that lacks explicit per-node permissions.
This follows the inheritance model defined by OPC UA Part 3, §5.2.9, where nodes without an explicit `RolePermissions` attribute inherit the namespace `DefaultRolePermissions`. OPC 10000-3 §4.8.3 mandates a **default-deny** evaluation (`Bad_UserAccessDenied` when the operation bits are not set); `node-opcua` instead **grants all permissions**.
The root cause is a combination of an authorization **fail-open** and a **disconnect** between the configuration API and the runtime enforcement path.
---
## Affected configuration
This advisory covers two cases that are not equally severe:
1. No RolePermissions declared anywhere - resolution is permissive. This is node-opcua's documented behaviour for a server with no access control configured, so nothing is being bypassed. Worth fixing as an insecure default (CWE-1188), but it is not the 9.1 bypass. Stock Opc.Ua.NodeSet2.xml ships DefaultRolePermissions with no Value, so a server that declared no policy is NOT exposed.
2. A policy is declared and silently ignored - setDefaultRolePermissions() succeeds and does nothing, so an operator who believes they locked the namespace down has not. This is the real bypass and this is what earns CVSS 9.1. It requires that someone declared a namespace default.
Everything below describes case 2 unless stated otherwise.
## Root Cause Analysis
### Bug 1 - `getPermissionForRole(null)` returns `allPermissions` (violates §4.8.3 default-deny)
File: `packages/node-opcua-address-space/source/session_context.ts:151-153`
```ts
function getPermissionForRole(rolePermissions: RolePermissionType[] | null, role: NodeId): PermissionFlag {
if (rolePermissions === null) {
return allPermissions; // null means "grant everything" to ANY role, including Anonymous
}
```
When the applicable policy resolves to `null`, the function returns `allPermissions` (Read, Write, Call) to whichever role is checking permissions, **including Anonymous**. OPC 10000-3 §4.8.3 requires the opposite: *"If they are not set the Server returns `Bad_UserAccessDenied`."*
### Bug 2 - The namespace default resolves to `null` on the enforcement path
The runtime enforcement reads the `DefaultRolePermissions` / `DefaultUserRolePermissions` Variable nodes under `Server/Namespaces/<ns>`. These resolve to `null` in every reachable configuration:
- **NodeSet2-loaded namespaces** (DI / ADI / vendor) ship the Property **without a `Value`** (`null`).
- **Programmatically-created namespaces** have **no `NamespaceMetadata` node** under `Server/Namespaces`, so the lookup returns `null`.
Additionally, `server_engine.ts:947-957` rewrites these nodes to a Null-typed value on every `initialize()`, with no restore:
```ts
for (const ns of namespacesNode.getComponents()) {
const defaultRolePermissions = ns.getChildByName("DefaultRolePermissions") as UAVariable | null;
if (defaultRolePermissions) {
defaultRolePermissions.setValueFromSource({ dataType: DataType.Null });
}
}
```
> **Note:** the loaded value is already `null` in stock nodesets, so this reset only changes the value's `dataType` tag; it is **not** the sole cause, the namespace default is `null` regardless.
### Bug 3 - Two incoherent enforcement paths
There are two separate and disconnected paths to resolve namespace-default permissions.
**Path A (private field)** - `Namespace.setDefaultRolePermissions()` writes the policy exclusively to a JavaScript private field in `namespace_impl.ts`:
```ts
public setDefaultRolePermissions(rolePermissions: RolePermissionTypeOptions[] | null): void {
this.defaultRolePermissions = rolePermissions ? coerceRolePermissions(rolePermissions) : undefined;
}
```
This is the value read by local getters (e.g. `BaseNodeImpl.getRolePermissions(inherited=true)`).
**Path B (UAVariable node)** - the runtime access-control enforcement (Read/Write/Call) queries the `DefaultRolePermissions` **UAVariable node** instead of the private field (`session_context.ts`):
```ts
const defaultRolePermissions = uaNamespaceObject.getChildByName("DefaultRolePermissions") as UAVariable;
if (defaultRolePermissions) {
const dataValue = defaultRolePermissions.readValue();
if (dataValue?.statusCode.isGood()) {
return dataValue.value.value as RolePermissionType[] | null;
}
}
```
Because Path B reads the variable node and Path A writes the private field, the two are disconnected. The enforcement path resolves the namespace default to `null`, the metadata node is **absent** (programmatic namespace) or **Null-valued** (nodeset namespace) and the operator's `setDefaultRolePermissions()` field is never consulted. That `null` then triggers the fail-open (Bug 1).
> *Measured:* with `setDefaultRolePermissions([Operator])` applied, `namespace.getDefaultRolePermissions()` returns the policy while `getApplicableRolePermissions()` returns `null`.
Synchronization between the two paths only happens if the operator calls `setNamespaceMetaData()`, which binds the field to the node via `bindVariable()`:
```ts
metaData.defaultRolePermissions?.bindVariable(
{
get: () =>
new Variant({
dataType: DataType.ExtensionObject,
arrayType: VariantArrayType.Array,
value: namespace.getDefaultRolePermissions()
})
},
true
);
```
Without calling `setNamespaceMetaData()`, `setDefaultRolePermissions()` has **no effect** on runtime authorization. **Furthermore, on NodeSet2-loaded namespaces `setNamespaceMetaData()` throws `"INamespace meta data already exists"` (PoC-C), so for those namespaces there is no working way to activate the namespace default at all.**
---
## Steps to Reproduce
### PoC-A - Address-space level (unit test, no network)
Save as `packages/node-opcua-address-space/test/test_poc_rbac_failo…
Check your whole app
Dependencies are only half of it. Free and read-only: before you push, run npx shippable-dev scan localhost:3000 in your project folder, no account needed. For your live app, you prove it's yours with a one-line tag first.
References
- github.com/node-opcua/node-opcua/security/advisories/GHSA-xggf-m53x-jc3f
- github.com/node-opcua/node-opcua/pull/1580
- github.com/node-opcua/node-opcua/commit/0261e873900800983c622e01120f484dc6063698
- github.com/node-opcua/node-opcua/releases/tag/v2.180.0
- nvd.nist.gov/vuln/detail/CVE-2026-95860
- github.com/advisories/GHSA-xggf-m53x-jc3f
- github.com/node-opcua/node-opcua
Merged from ENISA EUVD, GitHub Advisory Database, OSV. Last updated 11 Nov 2026. All vulnerabilities · RSS · JSON