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.
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.
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
- Create an empty file at /tmp/videostream_0.5.0.tar.gz to gain write permission.
- Create a malicious tar.gz containing a LaunchDaemon plist.
- Create a fake manifest.json with a higher version number.
- Run a script to repeatedly copy the fake manifest to /tmp/[PID] using the updater's PID.
- Run a script to repeatedly copy the malicious tar.gz to /tmp/videostream_0.5.0.tar.gz.
- 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.