Back to Blog
critical SEVERITY6 min read

How WebSocket Protocol Handler Vulnerabilities happen in Node.js Dependencies and how to fix it

A critical vulnerability (CVE-2026-54466) was discovered in websocket-driver version 0.7.4, a WebSocket protocol handler used in the dependency tree. The vulnerability allowed attackers to exploit flaws in WebSocket frame parsing, potentially leading to denial of service or protocol-level attacks. The fix upgraded websocket-driver to version 0.7.5, which patches the protocol handling vulnerabilities and hardens input validation for untrusted WebSocket frames.

O
By Orbis AppSec
•Technically reviewed by Anupam Mediratta•Published August 28, 2026•Reviewed August 28, 2026

Answer Summary

CVE-2026-54466 is a critical vulnerability in the websocket-driver npm package version 0.7.4, affecting WebSocket protocol handling in Node.js applications. The vulnerability stems from improper validation of WebSocket frames, allowing attackers to send malformed protocol messages that could bypass security checks or cause service disruption. The fix upgrades websocket-driver from 0.7.4 to 0.7.5 by adding a dependency override in package.json and updating package-lock.json, ensuring all transitive dependencies use the patched version that properly validates WebSocket frame structures.

Vulnerability at a Glance

cweN/A (CVE-specific)
fixUpgrade websocket-driver to version 0.7.5 using npm dependency overrides
riskMalformed WebSocket frames could bypass protocol validation, leading to denial of service or protocol-level attacks
languageJavaScript/Node.js
root causeInsufficient input validation in websocket-driver 0.7.4's frame parsing logic
vulnerabilityWebSocket Protocol Handler Vulnerability (CVE-2026-54466)

Introduction

In a Node.js application's dependency tree, Trivy scanner flagged a critical vulnerability: CVE-2026-54466 in websocket-driver version 0.7.4. This WebSocket protocol handler, buried deep in the transitive dependencies of package-lock.json, contained a flaw in how it parsed and validated WebSocket frames. While the vulnerability wasn't confirmed as directly reachable in the application code, its presence in the dependency tree posed a significant risk—any component using WebSocket connections could potentially be exploited through malformed protocol messages.

The vulnerability affected websocket-driver at version 0.7.4, specifically in its frame parsing logic. This package serves as the low-level WebSocket protocol implementation for various Node.js WebSocket libraries, making it a critical component in the security chain. A flaw at this level could affect any application feature that handles WebSocket connections, from real-time debugging tools to live data streaming.

The Vulnerability Explained

The websocket-driver package implements the WebSocket protocol (RFC 6455), handling the low-level details of frame parsing, masking, and message assembly. Version 0.7.4 contained a vulnerability in how it processed untrusted WebSocket frames, specifically in the validation logic that checks frame structure and opcodes.

Here's what the vulnerable dependency looked like in package-lock.json:

"node_modules/websocket-driver": {
  "version": "0.7.4",
  "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz",
  "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==",
  "license": "Apache-2.0",
  "dependencies": {
    "http-parser-js": ">=0.5.1",
    "safe-buffer": ">=5.1.0",
    "websocket-extensions": ">=0.1.1"
  }
}

The vulnerability in version 0.7.4 allowed attackers to craft malformed WebSocket frames that could:

  1. Bypass protocol validation checks: By sending frames with invalid opcode combinations or malformed length fields, attackers could trigger unexpected code paths in the parser
  2. Cause denial of service: Specially crafted frames could consume excessive CPU or memory during parsing
  3. Potentially execute protocol-level attacks: Depending on how the application handled parsed frames, the vulnerability could enable message injection or connection hijacking

Attack Scenario

Consider the OttoSimulator component referenced in the vulnerability context. If this component uses WebSocket connections for real-time debugging or plugin communication, an attacker could:

  1. Establish a WebSocket connection to the debugging interface
  2. Send a malformed frame with an invalid opcode sequence (e.g., a continuation frame without an initial frame)
  3. The vulnerable websocket-driver 0.7.4 would fail to properly validate the frame structure
  4. The malformed frame could bypass security checks, potentially injecting commands into the debugging session or causing the parser to crash

The real danger is that this vulnerability sits at the protocol layer—before application-level validation. Even if the application code properly validates message content, the protocol handler itself could be exploited before the application ever sees the data.

The Fix

The fix for CVE-2026-54466 required two specific changes to ensure the patched version of websocket-driver was used throughout the entire dependency tree:

Change 1: Update package-lock.json

The direct dependency reference was updated to version 0.7.5:

 "node_modules/websocket-driver": {
-  "version": "0.7.4",
-  "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz",
-  "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==",
+  "version": "0.7.5",
+  "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.5.tgz",
+  "integrity": "sha512-ZL2+3c7kMBdIRCMz6l8jQMHyGVxj+UL+xVk74Ombiciboca8rHa15L86B19E5oh1pL9Ii/uj54gtsIrZGMo6zA==",
   "license": "Apache-2.0",

Change 2: Add Dependency Override in package.json

Critically, the fix also added an override directive to ensure all transitive dependencies use the patched version:

 "overrides": {
-  "shell-quote": "1.9.0"
+  "shell-quote": "1.9.0",
+  "websocket-driver": "0.7.5"
 }

Why both changes are necessary: Simply updating package-lock.json isn't sufficient because websocket-driver might be pulled in as a transitive dependency by other packages. The overrides field in package.json forces npm to use version 0.7.5 for all instances of websocket-driver in the dependency tree, regardless of what version other packages request.

What Version 0.7.5 Fixed

The patched version 0.7.5 includes:

  • Hardened frame validation: Stricter checks on frame opcodes, length fields, and continuation frame sequences
  • Improved error handling: Proper rejection of malformed frames instead of attempting to parse them
  • Enhanced protocol compliance: Better adherence to RFC 6455 edge cases that could be exploited

The security improvement is concrete: any WebSocket connection using the patched version now properly validates frame structure before processing the payload, preventing protocol-level attacks from reaching the application layer.

Key Takeaways

  • Transitive dependencies matter: CVE-2026-54466 wasn't in direct dependencies but in websocket-driver deep in the dependency tree, showing that you must scan and secure the entire dependency graph
  • Use dependency overrides for security: Simply updating package-lock.json isn't enough—the overrides field in package.json ensures all instances of websocket-driver use version 0.7.5 across nested dependencies
  • Protocol-level vulnerabilities bypass application security: Flaws in websocket-driver's frame parsing occur before application-level validation, making library security critical for WebSocket-based features
  • Automated scanning catches hidden risks: Trivy detected this vulnerability in package-lock.json before it could be exploited, demonstrating the value of continuous dependency scanning
  • Version 0.7.5 hardens frame validation: The patch strengthens opcode validation, length field checks, and continuation frame handling to prevent malformed WebSocket frames from bypassing protocol security

How Orbis AppSec Detected This

  • Source: Transitive dependency websocket-driver version 0.7.4 in package-lock.json
  • Sink: WebSocket frame parsing logic in the websocket-driver library that handles untrusted network input
  • Missing control: Insufficient validation of WebSocket frame structure, opcodes, and length fields in version 0.7.4
  • CWE: Related to CWE-20 (Improper Input Validation) at the protocol layer
  • Fix: Upgraded websocket-driver to version 0.7.5 using dependency override in package.json to ensure the patched version is used throughout the dependency tree

Orbis AppSec automatically detected this vulnerability and opened a pull request with the fix. Try Orbis AppSec on your repositories to find and fix issues like this automatically.

Conclusion

CVE-2026-54466 in websocket-driver 0.7.4 demonstrates that security vulnerabilities can lurk deep in your dependency tree, far from your application code. This critical flaw in WebSocket protocol handling could have enabled protocol-level attacks before any application-level security checks had a chance to run. The fix—upgrading to version 0.7.5 with a dependency override—shows the importance of both updating vulnerable packages and ensuring those updates propagate throughout your entire dependency graph.

For developers working with WebSocket connections, this vulnerability is a reminder to implement layered security: use patched libraries, validate at the application layer, and continuously scan dependencies for known vulnerabilities. By combining automated scanning tools like Trivy with proper dependency management practices, you can catch and fix vulnerabilities before they reach production.

Prevention and further reading

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #12

Related Articles

medium

path-to-regexp 0.1.12 DoS: Catastrophic Backtracking on Malformed URL

path-to-regexp version 0.1.12 contains a regular expression engine vulnerability where maliciously crafted URL parameters trigger exponential backtracking, causing CPU exhaustion and service unavailability. Upgrading to version 0.1.13 eliminates the vulnerable pattern from the parsing logic.

critical

CVE-2026-59873: node-tar 7.5.11 DoS via Crafted Gzip Bomb

node-tar versions 7.5.11 through 7.5.18 are vulnerable to a denial-of-service attack through maliciously crafted gzip archives that decompress to disproportionately large sizes. An attacker can exploit this to exhaust memory and CPU resources by submitting a small, highly compressed archive that expands beyond configured limits during extraction.

high

MapManager.get() Race Condition Duplicates API Requests

The MapManager's `get(mapUid, cache)` method used a check-then-act pattern that permitted multiple concurrent requests to pass the cache miss check simultaneously, triggering redundant API calls and risking cache corruption. The fix introduces a `_pending` promise map to deduplicate in-flight fetches for identical map UIDs.

critical

Lampa Desktop Auto-Update Heuristic Bypass: Execution of Unverified

Lampa Desktop's auto-update mechanism downloaded JavaScript and CSS from `raw.githubusercontent.com` using only heuristic validation—file size thresholds and string pattern matching—that attackers could trivially satisfy. The fix introduces cryptographic integrity verification by cross-referencing Git blob hashes from the GitHub Contents API, ensuring downloaded code matches the repository's authoritative state before execution.

high

adm-zip 0.6.0 Preserves SUID Bits From ZIPs: CVE-2026-102282

The `adm-zip` dependency resolved to 0.6.0 in this project's dependency tree, a version affected by CVE-2026-102282: during extraction it applies the Unix permission bits stored in each ZIP entry's external file attributes verbatim, including the setuid (`04000`), setgid (`02000`), and sticky bits. An attacker who controls an archive passed to `extractAllTo()` or `extractEntryTo()` can therefore have the extractor create a setuid binary owned by whatever user the extraction process runs as. The

high

requestInput() Type Confusion: NaN and Object Bypass in JavaScript

The `requestInput()` utility function lacked validation on its `type` parameter and failed to handle `NaN` results from float conversions, creating a type confusion weakness. An attacker could supply malformed inputs that propagate unhandled `NaN` values or unexpected object types through the type system. The fix adds explicit guards against `NaN` type parameters and rejects non-primitive type values.