vBulletin <= 4.2.3 SQL Injection
The vBulletin forumrunner addon passed user-supplied 'postids' and 'threadid' parameters into SQL queries after only filtering them as strings, without converting to integers. An attacker could call the get_spam_data function with a crafted 'postids' value to inject SQL and read or modify the database.
The vBulletin core forumrunner addon (enabled by default) was affected by an SQL injection vulnerability but gained little to no coverage but a mere forum post. Well, until now.
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 code used a string filter (TYPE_STRING) on the 'postids' and 'threadid' parameters and then placed them directly into an SQL IN clause, instead of converting them to integers with intval().
Impact
An attacker could execute arbitrary SQL queries against the forum database, potentially reading or modifying data; the text does not state whether any defence limited the attack.
What the attacker needed
Forumrunner addon enabled (default); network access to the forum
The fix
The fix was to add a function that converts each comma-separated value to an integer and apply it to both the 'postids' and 'threadid' parameters before they are used in the query.
How it was found
- Send a request to the forumrunner request handler with the 'cmd' parameter set to 'get_spam_data'.
- Include the 'd' parameter to turn on error reporting, which helps with the injection.
- Supply a crafted SQL payload in the 'postids' parameter (or 'threadid') to inject into the query.
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 forum software took a value from the user and put it straight into a database command without checking it was a number. Because the value was only treated as text, an attacker could include extra database instructions in it. This is called SQL injection: it lets an attacker talk directly to the database.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.