YouPHPTube /objects/video.php getVideo search code execution vulnerability
The getVideo function in YouPHPTube builds an SQL query by inserting the search phrase directly into the string when the VideoTags plugin is enabled, so an unauthenticated attacker can inject SQL. Because a column from that query is later used to choose which PHP file is included, the injection can also be used to include local files and potentially run code.
Originally disclosed on Cisco Talos
An exploitable SQL injection vulnerability exist in YouPHPTube 7.7. When the “VideoTags” plugin is enabled, a specially crafted unauthenticated HTTP request can cause a SQL injection, possibly leading to denial of service, exfiltration of the database and local file inclusion, which could potentially further lead to…
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 search phrase is concatenated into the SQL string without parameterisation, and a value returned by that query is then used unsanitised as a file path in a require statement.
Impact
An unauthenticated attacker could read or disrupt the database and include local files, which could potentially lead to code execution; the proof of concept only shows a failed include and a delayed response.
What the attacker needed
VideoTags plugin enabled; no authentication needed
The fix
The vendor patched the issue according to the timeline.
How it was found
- Send an unauthenticated request to the site's index page with a crafted search parameter.
- The search value is placed into the SQL query because the VideoTags plugin is enabled.
- The injected query returns a chosen value in the type column.
- The page includes a PHP file whose name is built from that value, showing the file inclusion.
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.
The site takes text from a search box and pastes it straight into a database command instead of treating it as plain text. That lets an attacker add their own database instructions, and here the result of the query also decides which file the page loads, so the attacker can point it at files on the server.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.