Vbulletin2shell
vBulletin is forum and community software. In their own words, it is the world leader in forum and community publishing software and serves over 40,000 online communities.
Proof of concept, run as a guest
The shell above is a simulation. Nothing you type leaves this page. Try id , ls or help .
vBulletin2Shell is an unauthenticated remote code execution vulnerability in vBulletin, the forum software. A visitor who is not logged in sends one POST request, and the server runs any PHP function or operating system command they choose, as the web server user. The output comes back in the same response.
The root cause is a PHP object injection (CWE-502). A value from the request reaches PHP's unserialize() with no class restriction, and classes that ship with vBulletin turn the injected object into code execution.
The web server user can read the forum's configuration file, and through it the database: private messages, email addresses and password hashes.
vBulletin has published a patch note . The patch makes unserialize() refuse all objects, which breaks the attack.
vBulletin 6.2.4 Patch Level 1
vBulletin 6.2.3 Patch Level 1
vBulletin 6.2.2 Patch Level 1
vBulletin Cloud is already safe. vBulletin patches it automatically, so Cloud admins don't need to do anything.
On 6.2.4, 6.2.3 or 6.2.2, download the patch for your version from members.vbulletin.com/patches.php and upload its files to your server. On an older version, upgrade to 6.2.4 Patch Level 1.
If you can't patch straight away, use a WAF to block POST requests to /ajax/render/contententry_editor . vBulletin also accepts the route as a routestring parameter, so block routestring=ajax/render/contententry_editor in the query string and the body too.
View the source of your forum's page and look for the generator tag. It shows the version without the patch level.
The call chain, in order. Paths are relative to vBulletin's upload/ folder.
#0 Guest Sends one POST request. No session.
#1 POST /ajax/render/contententry_editor Guests can render almost any template, and the POST fields become its variables.
#2 bbcode::parseWysiwyg() The template hands conversation[rawtext] and conversation[attachments] to the BBCode parser. The text [ATTACH=CONFIG]n1[/ATTACH] makes it read the settings of fake attachment 1.
#3 unserialize() Runs on settings with no class restriction, in includes/vb5/template/bbcode.php . This is the root cause.
#4 FileCookieJar::__destruct() → PumpStream::__toString() → HandlerStack::resolve() Guzzle classes bundled with vBulletin. A first object, vB_Mail_Transport_PhpMailer_Smtp , makes the autoloader load Guzzle. resolve() then calls any chain of PHP functions on an attacker-chosen string.
#5 shell_exec("id") Runs as the web server user. The output is base64-encoded into an error message ( Undefined constant "…" ) that comes back in the JSON response.
A guest sends this one request, and the server runs the command id . Most fields just set up the template from step #1. The last one, settings , is the payload: a serialized PHP object, URL-encoded.
Here is the settings value after URL-decoding. \0 stands for a NUL byte, which PHP puts in the names of private and protected properties.
It is an array of two objects:
Object 0 , vB_Mail_Transport_PhpMailer_Smtp , does nothing by itself. Creating it makes vBulletin's autoloader load the Guzzle library, so the classes in object 1 exist.
Object 1 , FileCookieJar , is the gadget chain. When PHP destroys it, it ends up in HandlerStack::resolve() , which passes the handler value ( "id" ) through each function in stack .
stack runs from last to first, so the server runs constant(base64_encode(shell_exec("id"))) : run id , base64-encode the output, then look up a PHP constant with that name.
No constant has that name, so PHP throws an error that contains it. vBulletin sends the error back in its JSON response:
Decode the base64 to read the command output:
Other vulnerabilities found
Researching vBulletin2Shell turned up 6 more vulnerabilities in vBulletin. All were reported privately to vBulletin. Details stay private until each one is fixed.
