WWBN AVideo import.json.php temporary copy unrestricted php file upload vulnerability
The import.json.php endpoint copies an uploaded file to a temporary location without its extension, allowing an attacker to place a PHP file in /tmp. When chained with a local file inclusion vulnerability, this can lead to arbitrary code execution.
Originally disclosed on Cisco Talos
A unrestricted php file upload vulnerability exists in the import.json.php temporary copy functionality of WWBN AVideo dev master commit 15fed957fb. A specially crafted HTTP request can lead to arbitrary code execution when chained with an LFI vulnerability.
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 import.json.php script copies a user-supplied file to a temporary directory using only the filename without its extension, allowing a .php file to be written to a predictable location.
Impact
An attacker could execute arbitrary code on the server if they can also exploit a local file inclusion vulnerability, though the temporary file is only available briefly.
What the attacker needed
Permission to upload videos; a local file inclusion vulnerability
How it was found
- Upload a video file with a crafted resolution parameter to create a file with a .php extension in the videos directory.
- Send a request to import.json.php with the fileURI pointing to the uploaded file.
- The script copies the file to /tmp without its extension, creating a .php file.
- Exploit a local file inclusion vulnerability to execute the PHP file before it is moved.
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.
This report describes a flaw in a video-sharing web app that lets someone upload a file and have it saved with a dangerous extension like .php. If another bug lets the attacker run that file, they could execute their own code on the server. The attack requires the attacker to already have permission to upload videos and to combine it with a separate file-inclusion bug.
What is File upload?
An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.