@dervix/ws
This report shows the evidence for @dervix/ws@8.21.5. 5 of 6 known versions are blocked or flagged. The newest version, 8.21.7, is flagged. See all versions.
OpenSSF/OSV Malicious Advisory
imported 3mo ago · by OpenSSF/OSVOpenSSF/OSV advisory MAL-2026-6496 confirms this npm version as malicious.
Advisory
MAL-2026-6496
Source
OpenSSF Malicious Packages via OSV
Summary
Malicious code in @dervix/ws (npm)
Details
Package `@dervix/ws` impersonates the popular `ws` WebSocket library — `package.json` copies the legitimate ws project's homepage (`https://github.com/websockets/ws`), repository, and author metadata while publishing under an unrelated scope. `lib/websocket.js` appends ~130KB of heavily obfuscated code after the genuine `socketOnError` function; this payload executes at `require()` time via `index.js`. On import the payload (1) re-spawns the current Node process detached with `stdio:'ignore'` and `windowsHide:true`, gated by an obfuscated marker env var so the parent returns cleanly while a daemonized child continues; (2) constructs an AES-256 key by XOR-combining four hardcoded hex Buffers; (3) issues an HTTPS GET (following 3xx redirects) to an encrypted-in-source URL, streams the response to a file under `os.tmpdir()`, and decrypts it via `createDecipheriv`; (4) `fs.chmodSync(path, 0o755)` and `child_process.spawn(path,...)` with `detached:true` then `unref()`s it. Dynamic `import('child_process')` / `import('path')` is used to defeat static `require` audits, and an `inspector.url()` check short-circuits execution when a debugger is attached. There is no signature verification, no version pinning, and the destination URL is RC4-decoded at runtime so it cannot be inspected statically. Combined with the cloned ws metadata, this is a deliberate typosquat dropper that lands and executes attacker-controlled binary code on any machine that installs and imports the package.
## Source: ghsa-malware (b0c3046401ca7c230339c585db9d1e925c670b5739209048b6d29f88b14ddc01) Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
Independent scan evidence
public snapshotBehavioral surface
CryptoEnvironmentVarsNetwork
HighEntropyStringsUrlStrings
Source & flagged code
1 flagged · loading sourcelib/websocket-server.jsView file
5const EventEmitter = require('events');
L6: const http = require('http');
L7: const { Duplex } = require('stream');
...
L109: });
L110: res.end(body);
L111: });
...
L369: * @throws {Error} If called more than once with the same socket
L370: * @private
L371: */
...
L388: .update(key + GUID)
L389: .digest('base64');
L390:
Low
Weak Crypto
Package source references weak cryptographic algorithms.
lib/websocket-server.jsView on unpkg · L5Findings
2 Medium4 Low
MediumNetwork
MediumEnvironment Vars
LowScripts Present
LowWeak Cryptolib/websocket-server.js
LowHigh Entropy Strings
LowUrl Strings
Affected versions and remediation
This report applies to @dervix/ws@8.21.5.
The versions list below shows the verdict for each recorded version.
- Avoid installing @dervix/ws@8.21.5. Remove it from direct dependencies and check your lockfile for transitive copies.
- Choose an independently verified alternative or release. This report does not establish that other versions are safe.
- If this version ran, investigate the affected machine and build environment. Rotate credentials it could access and rebuild from a trusted environment.
Evidence last updated: .
Source advisory published: .
Think this verdict is wrong? Dispute it on GitHub or read how reports are produced.