# CVE-2026-68904: node-opcua TCP socket leak in keepalive reconnection

Source: https://junglewise.ai/threats/cve-2026-68904-node-opcua-tcp-socket-leak-in-keepalive-reconnection  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-09-16. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-68904 · Severity: high · CVSS 7 · Published 2026-09-16

node-opcua is a Node.js library for connecting to OPC UA industrial automation servers. A resource exhaustion vulnerability allows TCP sockets to accumulate in FIN-WAIT-2 state during automatic reconnection cycles, causing memory exhaustion and process crashes. The issue is triggered by default settings when the remote server has clock skew relative to the client.

Technologies: [node-opcua (npm)](https://junglewise.ai/threats/technologies/node-opcua). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2026-68904 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-68904 being exploited in the wild.

**How severe is CVE-2026-68904?** High severity, with a CVSS score of 7, published 16 September 2026.

**Which products and versions are affected?** node-opcua (npm) >= 2.0.0, < 2.170.0, SEMVER:introduced=2.0.0,fixed=2.170.0; node-opcua-client (npm) >= 2.0.0, < 2.170.0, SEMVER:introduced=2.0.0,fixed=2.170.0; node-opcua-transport (npm) >= 2.0.0, < 2.170.0, SEMVER:introduced=2.0.0,fixed=2.170.0.

**Is there a fix for CVE-2026-68904?** Yes. node-opcua (npm): upgrade to 2.170.0 or later; node-opcua-client (npm): upgrade to 2.170.0 or later; node-opcua-transport (npm): upgrade to 2.170.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-68904 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-68904?** Check whether you run node-opcua (npm), node-opcua-client (npm) or node-opcua-transport (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- node-opcua (npm): upgrade to 2.170.0 or later

  ```sh
  npm install node-opcua@2.170.0
  ```

- node-opcua-client (npm): upgrade to 2.170.0 or later

  ```sh
  npm install node-opcua-client@2.170.0
  ```

- node-opcua-transport (npm): upgrade to 2.170.0 or later

  ```sh
  npm install node-opcua-transport@2.170.0
  ```


## Technical details

The vulnerability combines two bugs in node-opcua. First, ClientTCP_transport._on_ACK_response() calls socket.end() instead of socket.destroy() on failed handshakes, leaving sockets in FIN-WAIT-2 state if the peer doesn't respond (common with PLCs). Second, ClientSessionKeepAliveManager._ping_server() incorrectly treats BadInvalidTimestamp responses (application-level OPC UA status codes caused by clock skew) as fatal network errors, triggering reconnection on every keepalive ping. With default keepAliveInterval of 3 seconds, this causes ~20 socket leaks per minute. No special privileges or user interaction required; the vulnerability is triggered by default configuration (keepSessionAlive: true) when connecting to a server with clock skew. Fixed in version 2.170.0.

## Affected products

- node-opcua node-opcua 2.0.0 to 2.169.0
- node-opcua node-opcua-client 2.0.0 to 2.169.0
- node-opcua node-opcua-transport 2.0.0 to 2.169.0

## Identifiers

- CVE-2026-68904
- GHSA-r2pf-9cw4-5j65

## Timeline

- 2026-09-16: disclosed: Advisory GHSA-r2pf-9cw4-5j65 published
- 2026-09-16: patched: Version 2.170.0 released with fixes

## References

- [https://api.github.com/users/Velluso](https://api.github.com/users/Velluso)
- [https://github.com/Velluso](https://github.com/Velluso)
- [https://api.github.com/users/Velluso/gists%7B/gist_id%7D](https://api.github.com/users/Velluso/gists%7B/gist_id%7D)
- [https://api.github.com/users/Velluso/repos](https://api.github.com/users/Velluso/repos)
- [https://avatars.githubusercontent.com/u/102395206?v=4](https://avatars.githubusercontent.com/u/102395206?v=4)
- [https://api.github.com/users/Velluso/events%7B/privacy%7D](https://api.github.com/users/Velluso/events%7B/privacy%7D)

## Related threats

- [node-opcua namespace-level access control bypass](https://junglewise.ai/threats/cve-2026-95860-node-opcua-is-an-opc-ua-implementation-for-typescript-and-node-js)
- [node-opcua unbounded nonce cache heap exhaustion](https://junglewise.ai/threats/cve-2026-54156-node-opcua-unbounded-nonce-cache-heap-exhaustion)
- [node-opcua missing nonce verification in UserNameIdentityToken authentication](https://junglewise.ai/threats/cve-2026-54155-node-opcua-missing-nonce-verification-in-usernameidentitytoken)
- [node-opcua denial of service via excessive CloseSession requests](https://junglewise.ai/threats/cve-2022-24375-node-opcua-denial-of-service-via-excessive-closesession-requests)
- [node-opcua denial of service via message chunks](https://junglewise.ai/threats/cve-2022-21208-node-opcua-denial-of-service-via-message-chunks)
