Skip to content
XSS Write-up Intermediate

Hijacking webcams with Screencastify

The Screencastify browser extension allowed any page on the screencastify.com domain to send it messages, including one that returned a Google OAuth access token with full Drive access and another that started a webcam recording without user interaction. An attacker who found an XSS on any of the many third-party-run subdomains could steal the token and the recorded video, or start a recording silently.

palant.info

Published on palant.info

2022-05-23 Security/Add-Ons 8 mins

Wladimir Palant, on palant.info

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

The extension's manifest listed the whole screencastify.com domain as externally connectable and exposed privileged messages (OAuth token retrieval, recording start) to any page on it, including subdomains run by third-party vendors.

Impact

An attacker could silently start a webcam recording and steal the resulting video plus other Google Drive contents, though the webcam LED may light up and the user must click a framed button for the XSS route.

What the attacker needed

Screencastify extension installed and onboarded; Webcam permission already granted; An XSS on a screencastify.com subdomain; Victim clicks a framed button

The fix

The extension was fixed by restricting externally_connectable to a short list of Screencastify-run subdomains and removing the token endpoint, and the XSS was resolved earlier.

How it was found

  1. Find an XSS on a screencastify.com subdomain, here a javascript: URL in a query parameter opened by a button on an error page.
  2. Frame the vulnerable page invisibly and position the button under the cursor so a click triggers the script.
  3. Use the script to message the extension and retrieve the Google OAuth token.
  4. Use the token to read the user's Google Drive, or message the extension to start a webcam recording.

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.

A browser extension can be told by certain websites to do things on the user's behalf. Here the extension trusted every page under screencastify.com, and many of those pages were run by outside companies. If any one of those pages had a flaw letting an attacker run their own code, the attacker could ask the extension for the user's Google Drive key or turn on the webcam.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.