Skip to content
CORS Write-up Intermediate

Login Process

Plex Media Server allowed cross-origin requests from any origin and stored the authentication token in a way accessible to JavaScript, so a malicious Plex server could steal the token when a victim logged in. An attacker could then use the token to access the victim's media server and, by chaining with other vulnerabilities, execute code as SYSTEM.

medium.com

Published on medium.com

I recently disclosed CVE-2020–5740 and CVE-2020–5741 in Plex Media Server for Windows that could be leveraged together to remotely execute code as SYSTEM. The catch is that you need an admin session token (X-Plex-Token) to gain the initial foothold in the application.

Chris Lyne, on medium.com

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

Impact

An attacker could gain full control of the victim's Plex Media Server and, by chaining with other vulnerabilities, execute code as SYSTEM; however, Plex has patched the issues and added a mitigation.

What the attacker needed

Victim is admin of a Plex server; victim clicks phishing link; victim logs into attacker's server

The fix

Plex patched the vulnerabilities and added a server-side mitigation that alerts users when logging into a non-Plex-hosted server.

How it was found

  1. Attacker sets up a malicious Plex Media Server and crafts a phishing email with a link to it.
  2. Victim clicks the link and logs into Plex through the attacker's server.
  3. The attacker's JavaScript reads the authentication token from localStorage.
  4. The JavaScript sends cross-origin requests to the victim's server using the stolen token.

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.

When you log into Plex through a server you don't own, that server's webpage can read your login token because the browser allows it to. The token is like a password that lets someone control your Plex server. The attacker tricks you into logging in through their server, then uses the stolen token to take over your server.

What is CORS?

A permissive cross-origin policy lets another site read responses with the user's credentials.

Similar reports

View all

Same bug class and techniques, clearest first.

CORS misconfiguration

The lesson behind this report.

A permissive cross-origin policy lets another site read responses with the user's credentials.