Facebook Google Plus Twitter LinkedIn YouTube RSS Menu Search Resource - BlogResource - WebinarResource - ReportResource - Eventicons_066 icons_067icons_068icons_069icons_070

Plex Media Server Local Privilege Escalation (Windows)

High

Synopsis

The Plex Update Service ("Plex Update Service.exe") contains a flaw that allows a local attacker to execute arbitrary Python code with SYSTEM privileges. The service exposes functionality over an ALPC port that can be invoked by a local, unauthenticated attacker.

The service is defined as such:

[
uuid(631c7d9c-1797-42f9-8e96-367a9ee58887),
version(1.0),
]
interface DefaultIfName
{

void Proc0(
	[in][string] wchar_t* arg_1);

long Proc1(
	[in][string] wchar_t* arg_1);

long Proc2(
	[in][string] wchar_t* arg_1, 
	[out]long *arg_2);
}

Specifically, Proc2 will execute a given executable if it is signed by Plex, even if it is not a legitimate update file. PlexScriptHost.exe (a Python interpreter) happens to be signed by Plex, and if a file named 'sitecustomize.py' is located in the current working directory, it will be executed when PlexScriptHost is launched. This is expected behavior for Python interpreters, and it can be abused to execute arbitrary code contained in sitecustomize.py.

Proof of Concept

https://github.com/tenable/poc/tree/master/plex/plex_media_server/tra_2020_25

Run the PoC and notice that the process is launched as SYSTEM. You will need to inspect the task list.

Launch RpcClient.exe to execute a command of your choosing, or by default execute the Windows Calculator. Below will add a new user.

> RpcClient.exe "net user /add scooby"

Below is a log entry in Plex Update Service.log showing a successful exploitation attempt.

Mar 31, 2020 14:05:05.324 [4796] DEBUG - Install() from UpdateInterface: C:\Users\lowpriv\Documents\RpcClient\RpcClient\Release\PlexScriptHost.exe
Mar 31, 2020 14:05:05.324 [4796] DEBUG - CheckBundle() from UpdateInterface: C:\Users\lowpriv\Documents\RpcClient\RpcClient\Release\PlexScriptHost.exe
Mar 31, 2020 14:05:05.324 [4796] DEBUG - Checking Certificate of installer: C:\Users\lowpriv\Documents\RpcClient\RpcClient\Release\PlexScriptHost.exe
Mar 31, 2020 14:05:05.324 [4796] DEBUG - Certificate integrity verified
Mar 31, 2020 14:05:05.324 [4796] DEBUG - HTTP requesting GET https://plex.tv/api/pmscert/profile
Mar 31, 2020 14:05:05.839 [4796] DEBUG - HTTP 200 response from GET https://plex.tv/api/pmscert/profile
Mar 31, 2020 14:05:05.839 [4796] DEBUG - Certificate identity verified
Mar 31, 2020 14:05:05.839 [4796] DEBUG - Create Process Success! Waiting for process to complete.
Mar 31, 2020 14:05:05.932 [4796] DEBUG - Installer exit code:  2 - The system cannot find the file specified.

Solution

Upgrade to 1.18.2 or newer. Additionally, Plex Media Server versions 1.19.1.2701 & 1.19.2.2702 (and newer) features additional hardening in the updater infrastructure to protect against future vulnerabilities

Disclosure Timeline

03/31/2020 - Tenable reports vulnerability
03/31/2020 - Plex is looking at the issue. They were able to download the PoC.
04/01/2020 - Tenable acknowledges.
04/03/2020 - Plex proposes a fix strategy. Also notifies me of bounty payout.
04/06/2020 - Tenable acknowledges fix strategy. Asks about anticipated patch release date.
04/07/2020 - Some back-and-forth on bounty specifics.
04/07/2020 - Plex hopes to release a patch before the end of the month. Nothing firm yet.
04/07/2020 - Tenable acknowleges.
04/07/2020 - More bounty specifics.
04/20/2020 - Plex sends a link to a beta update package. Asks if I will confirm the fix.
04/21/2020 - Tenable confirms that the package fixes the vulnerability. Exploit no longer works.

All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.

Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.

For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.

If you have questions or corrections about this advisory, please email [email protected]

Try for Free Buy Now

Try Tenable.io

FREE FOR 30 DAYS

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Sign up now.

Buy Tenable.io

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

65 assets

$2,275

Buy Now

Try for Free Buy Now

Try Nessus Professional Free

FREE FOR 7 DAYS

Nessus® is the most comprehensive vulnerability scanner on the market today. Nessus Professional will help automate the vulnerability scanning process, save time in your compliance cycles and allow you to engage your IT team.

Buy Nessus Professional

Nessus® is the most comprehensive vulnerability scanner on the market today. Nessus Professional will help automate the vulnerability scanning process, save time in your compliance cycles and allow you to engage your IT team.

Buy a multi-year license and save. Add Advanced Support for access to phone, email, community and chat support 24 hours a day, 365 days a year. Full details here.

Get FREE Advanced Support

with purchase of Nessus Professional

Try for Free Buy Now

Try Tenable.io Web Application Scanning

FREE FOR 30 DAYS

Enjoy full access to our latest web application scanning offering designed for modern applications as part of the Tenable.io platform. Safely scan your entire online portfolio for vulnerabilities with a high degree of accuracy without heavy manual effort or disruption to critical web applications. Sign up now.

Buy Tenable.io Web Application Scanning

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

5 FQDNs

$3,578

Buy Now

Try for Free Contact Sales

Try Tenable.io Container Security

FREE FOR 30 DAYS

Enjoy full access to the only container security offering integrated into a vulnerability management platform. Monitor container images for vulnerabilities, malware and policy violations. Integrate with continuous integration and continuous deployment (CI/CD) systems to support DevOps practices, strengthen security and support enterprise policy compliance.

Buy Tenable.io Container Security

Tenable.io Container Security seamlessly and securely enables DevOps processes by providing visibility into the security of container images – including vulnerabilities, malware and policy violations – through integration with the build process.

Learn More about Industrial Security

Get a Demo of Tenable.sc

Please fill out the form below with your contact information and a sales representative will contact you shortly to schedule a demo. You may also include a short comment (limited to 255 characters). Please note that fields with asterisks (*) are mandatory.

Try for Free Contact Sales

Try Tenable Lumin

FREE FOR 30 DAYS

Visualize and explore your Cyber Exposure, track risk reduction over time and benchmark against your peers with Tenable Lumin.

Buy Tenable Lumin

Contact a Sales Representative to see how Lumin can help you gain insight across your entire organization and manage cyber risk.

Request a demo of Tenable.ot

Get the Operational Technology Security You Need.
Reduce the Risk You Don’t.