Hacking Google Drive Integrations: A Deep Dive into OAuth Securi
The WebContentView component rendered third-party integration content without proper sanitisation, allowing an attacker to execute JavaScript in the context of Google Drive. Separately, the thumbnailLink field was fetched server-side without validation, enabling requests to internal metadata endpoints and potential access to service account tokens.
Published on infosecwriteups.com
Google Drive has become the backbone of modern cloud collaboration, with millions of users relying on it daily. But what happens when the very features designed to enhance productivity become attack vectors?
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely missing sanitisation of third-party content in WebContentView and missing validation of thumbnail URLs before server-side fetching.
Impact
An attacker could have stolen OAuth tokens, exfiltrated documents, and accessed internal Google Cloud resources, though the text does not confirm these were exploited in the wild.
What the attacker needed
Victim installs malicious OAuth app; attacker controls a server; victim views a file with malicious thumbnail
The fix
Google fixed the issues by sandboxing third-party content, enforcing strict CSP, sanitising HTML, isolating domains, and validating thumbnail URLs against a whitelist and private IP ranges.
How it was found
- Create a malicious OAuth application with a redirect URI pointing to an attacker-controlled server.
- Trick the victim into installing the malicious app via phishing or fake ads.
- Return an HTML response containing JavaScript when Google Drive requests file content.
- The script executes in the victim's browser, stealing OAuth tokens and exfiltrating files.
- For SSRF, register a file with a thumbnailLink pointing to an internal metadata endpoint.
- When a user views the file, Google's backend fetches the URL and returns sensitive token data.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
This report describes two bugs in Google Drive's integration system. The first let a malicious app run its own code inside Google Drive's website, which could steal a user's files. The second let an attacker make Google's servers fetch internal addresses, potentially exposing cloud credentials.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.