Dotclear <= 2.6.2 (categories.php) SQL Injection Vulnerability
The category reordering handler in the admin panel decodes a JSON parameter from the request and passes its fields into a database update method without sanitising them. An authenticated attacker could inject SQL through those fields to manipulate the database.
karmainsecurity.com
Published on karmainsecurity.com
User input passed through the $POST[‘categoriesorder’] parameter is not properly sanitized before being used in a call to the dcBlog::updCategoryPosition() method at line 76. This could be exploited to conduct SQL injection attacks leveraging the UPDATE statement defined in the nestedTree::updatePosition() method.
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
Likely the decoded JSON fields (item_id, left, right) are concatenated into the SQL query inside updCategoryPosition without validation or parameter binding.
Impact
An attacker with access to the admin category page could alter or read database contents beyond the intended reordering, though the text does not demonstrate a full exploit.
What the attacker needed
Access to the admin panel; ability to submit the category order form
The fix
The category position values should be validated as integers and passed to the database using parameterised queries.
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.
The admin page that lets you reorder blog categories reads a list of positions from the browser and saves them to the database. The code trusts the numbers in that list without checking them, so someone who can reach the admin page could slip database commands into those values. That is called SQL injection: sneaking database instructions into data the program expects to be plain values.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.