# [toolbox.teslamotors.com] HTML Injection via Prototype Pollution / Potential XSS

Prototype pollution in backbone.queryparams.js on Tesla Toolbox let an attacker inject HTML and a fullscreen fake-login iframe via crafted query params, blocked from XSS by CSP.

- Payout: $200
- Severity: low
- Program: Tesla
- Found by: BlackFan
- Disclosed: 2020-10-09
- Write-up quality: 6/10
- Original: https://bugcrowd.com/disclosures/57b28008-4653-4dec-88c3-4d38e40023ff/toolbox-teslamotors-com-html-injection-via-prototype-pollution-potential-xss
- Library page: https://bugbountylibrary.com/r/bc%3A792f3c12-0d77-496a-a9cc-39eda2bf9f3f
- Tags: area:web domain:web impact:integrity kind:bounty platform:bugcrowd sev:low tech:nodejs technique:chained technique:source-review vuln:prototype-pollution vuln:xss

**Target:** toolbox.teslamotors.com web app (Backbone.js query params parsing)
**Root cause:** backbone.queryparams.js parses URL query parameters into objects without filtering __proto__ keys, allowing Object.prototype pollution that downstream scripts read as config/display values.
**Steps:**
1. Load `https://toolbox.teslamotors.com/?__proto__.VULN=PROTOTYPE_POLLUTION` and confirm `Object.prototype.VULN` in console.
2. Inject HTML via `?__proto__.id=1&__proto__.id=1&__proto__.username=1&__proto__.username=1&&__proto__.display_name=%3Cmarquee%3E&__proto__.display_name=1`.
3. For fake login, set `__proto__.display_name` to an `<iframe srcdoc=...>` payload with a form posting to attacker host, styled fullscreen fixed.
4. Victim opens crafted URL; polluted prototype causes injected HTML/iframe to render.
**How found:** Recognized backbone.queryparams.js as a known prototype-pollution-prone library, tested __proto__ query param to confirm Object.prototype pollution, then traced which downstream properties (display_name, id, username) get rendered to achieve HTML injection.
**Exploitation:** Attacker crafts a URL with __proto__ query params; when a victim visits, prototype pollution causes the app to render attacker HTML including a fullscreen iframe srcdoc fake login form that submits credentials to //blackfan.ru/fk. Inline JS blocked by CSP, so impact limited to content spoofing/phishing.
**Insight:** When a page uses Backbone query param parsing, test `?__proto__.X=Y` to confirm pollution, then enumerate which polluted keys are later read into DOM sinks (display_name, id) to convert pollution into HTML injection even under strict CSP.

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

**Prototype pollution HTML injection URL**

```
https://toolbox.teslamotors.com/?__proto__.id=1&__proto__.id=1&__proto__.username=1&__proto__.username=1&&__proto__.display_name=%3Cmarquee%3E&__proto__.display_name=1
```

