Skip to content
Race condition Write-up Advanced

CVE-2023-25394 - VideoStream Local Privilege Escalation

The VideoStream updater on macOS downloads a manifest and a tar.gz package to predictable /tmp paths and extracts the package as root. An attacker can race to replace these files with a malicious manifest and tar.gz, leading to arbitrary file write as root and local privilege escalation.

Dan Revah Follow

Published on danrevah.github.io

VideoStream is a popular application that allows users to stream videos, music, and images to Google Chromecast devices effortlessly. Known for its user-friendly interface, it enables seamless playback of local video files and automatically transcodes them into Chromecast-compatible formats.

Dan Revah (@danrevah), on danrevah.github.io

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 updater uses predictable file names in /tmp and extracts a downloaded archive as root without verifying its integrity, allowing a local attacker to race and replace the files.

Impact

A local attacker could gain root privileges by writing arbitrary files as root, limited only by SIP protections.

What the attacker needed

Local access to the macOS system; VideoStream installed; ability to run scripts as a normal user

How it was found

  1. Create an empty file at /tmp/videostream_0.5.0.tar.gz to gain write permission.
  2. Create a malicious tar.gz containing a LaunchDaemon plist.
  3. Create a fake manifest.json with a higher version number.
  4. Run a script to repeatedly copy the fake manifest to /tmp/[PID] using the updater's PID.
  5. Run a script to repeatedly copy the malicious tar.gz to /tmp/videostream_0.5.0.tar.gz.
  6. Wait for the updater to run (every 5 hours or on boot) and extract the malicious tar.gz as root.

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.

VideoStream's updater runs as root and downloads files to /tmp with predictable names. An attacker can quickly replace those files with their own before the updater uses them, so the updater installs the attacker's files as root. This lets a normal user become root on the machine.

What is Race condition?

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.

More by Dan Revah

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.