# Using YouTube to steal your files

Path traversal in Google Slides YouTube embed videoid plus chained YouTube redirects let an attacker frame docs.google.com and one-click clickjack a Drive share dialog to grant editor access.

- Payout: $4,134
- Severity: high
- Program: Google
- Found by: Lyra Rebane
- Disclosed: 2024-09-19
- Write-up quality: 9/10
- Original: https://lyra.horse/blog/2024/09/using-youtube-to-steal-your-files/
- Library page: https://bugbountylibrary.com/r/blog%3Alyra-horse-blog-2024-09-using-youtube-to-steal-your-files
- Tags: area:web domain:web impact:data-leak impact:integrity kind:bounty platform:blog sev:high technique:chained vuln:clickjacking vuln:open-redirect vuln:path-traversal

**Target:** Google Slides YouTube embed iframe / YouTube redirects / Google Docs file preview
**Root cause:** Slides builds the embed URL from an unvalidated videoid, allowing `../` path traversal to arbitrary youtube.com paths; YouTube /signin and accounts.youtube.com SetSID allow redirects to Google domains, and docs.google.com/file/d/{ID}/edit is framable and honors userstoinvite to prefill a share dialog.
**Steps:**
1. Set videoid to `../` to traverse from /embed/ to youtube.com root in the Slides iframe.
2. Find framable youtube.com paths and open redirects: `/signin?next=` allows any *.youtube.com subdomain; `accounts.youtube.com/accounts/SetSID?continue=` allows Google domains like docs.google.com.
3. Chain: `../signin?next=https%3A%2F%2Faccounts.youtube.com%2Faccounts%2FSetSID%3Fcontinue%3Dhttps%3A%2F%2Fdocs.google.com%252F...` to land the iframe on docs.google.com.
4. Bypass Sec-Fetch-Dest/Site 403 by inserting a same-origin redirect `docs.google.com/a/a/file/d/.../edit` before the target file URL.
5. Use `docs.google.com/file/d/{ID}/edit?userstoinvite=attacker@email` which auto-fills the share dialog with Editor role.
6. Overlay a fake Google Forms UI with a cutout over the 'Send' button; victim single click grants editor access to attacker email.
**How found:** Noticed Slides constructs embed URL from user-controlled videoid, tried `../` traversal; explored framable youtube.com paths, hunted open redirects in auth flows, found docs.google.com/file/d/{ID}/edit stays on docs domain and is framable; discovered userstoinvite param auto-fills share dialog; hit Sec-Fetch-Site 403 and bypassed via legacy /a/a/ same-origin redirect.
**Exploitation:** Attacker crafts a Slides presentation whose embedded YouTube iframe path-traverses and chains redirects to a docs.google.com file preview with userstoinvite prefilled; victim opens /present and clicks a disguised 'Send' button, sharing the target Drive file/folder with the attacker as Editor.
**Escalation:** Chained path traversal + two open redirects + legacy /a/a/ same-origin redirect to bypass Sec-Fetch-Site mitigation, then reduced multi-click social engineering to a single clickjack.
**Insight:** When a component interpolates an ID into a URL path, test `../` traversal to reach sibling endpoints; and when server-side Sec-Fetch-Site blocks cross-site framing, look for a same-origin redirect on the target domain (legacy path formats like /a/<domain>/) to reset the header.

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

**Final path-traversed videoid exploit chain**

```
../signin?next=https%3A%2F%2Faccounts.youtube.com%2Faccounts%2FSetSID%3Fcontinue%3Dhttps%3A%2F%2Fdocs.google.com%252Ffile%252Fd%252F1sHy3aQXsIlnOCj-mBFxQ0ZXm4TzjjfFL%252Fedit%253Fuserstoinvite%253Dlyra.horse%2540gmail.com
```

**One-click share dialog URL with userstoinvite**

```
docs.google.com/file/d/1sHy3aQXsIlnOCj-mBFxQ0ZXm4TzjjfFL.../edit?userstoinvite=lyra.horse@gmail.com
```

**accounts.youtube.com SetSID redirect with continue**

```
https://accounts.youtube.com/accounts/SetSID?ssdc=1&sidt=&continue=https%3A%2F%2Fwww.google.com&tcc=1&dbus=EE
```

