WWBN AVideo aVideoEncoder.json.php unzip race condition vulnerability
A race condition exists between unzipping an uploaded archive and cleaning disallowed file types from the destination folder, so a file is briefly reachable over HTTP before it is removed. By chaining this with a separate flaw that lets .phar files execute inside the videos directory, an attacker with upload permission could run arbitrary PHP code.
Originally disclosed on Cisco Talos
A race condition vulnerability exists in the aVideoEncoder.json.php unzip functionality of WWBN AVideo 14.4 and dev master commit 8a8954ff. A series of specially crafted HTTP request can lead to arbitrary code execution.
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the unzip and the clean-up run as separate steps with no locking, so extracted files are briefly served before the extension whitelist is enforced.
Impact
An attacker with video upload permission could execute arbitrary PHP code, but only by chaining this race with a separate .phar execution flaw, since a rule in videos/.htaccess blocks plain .php files there.
What the attacker needed
An account with video upload permission; precise timing of a request during unzip; chained .phar execution flaw
The fix
The vendor released a patch, though the text does not describe what it changed.
How it was found
- Send a request to the video encoder endpoint with a zip file as the video upload.
- Supply a resolution from the allowed list and set the format to zip so the archive is unpacked.
- While unpacking is in progress, request the extracted file over HTTP before clean-up removes it.
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 report has not been written yet. The Original tab links to the source.
When you upload a zip, the server unpacks it into a folder and then deletes files it does not want, such as scripts. For a short moment the unpacked files already exist and can be requested through the website. If an attacker times a request to land in that moment, they can reach a file that is about to be deleted, and combined with another weakness this can lead to running their own code on the server.
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.