Technical Analysis
A stored XSS in MyBB's video BBCode parsing allowed an attacker to inject JavaScript into private messages, and an authenticated RCE in the admin panel allowed writing a PHP shell via a truncated filename. An attacker with a user account could send a malicious private message to an administrator and, if the administrator had an active backend session, achieve remote code execution and take over the forum.
blog.ripstech.com
Published on blog.ripstech.com
We discovered a Stored XSS vulnerability that occured due to a parsing error in posts and private messages in MyBB 1.8.20 and prior versions, as well as an authenticated Remote Code Execution vulnerability that can be exploited by administrators of a forum.
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 video BBCode parser called urldecode() on the URL, bypassing regex filters and allowing BBCode injection that corrupted HTML attributes; separately, the stylesheet filename length was not validated before database insertion, leading to truncation that removed the .css extension.
Impact
An attacker could take over the forum, gaining access to all user accounts, private threads and messages, but only if an administrator opens the malicious private message while having an active backend session.
What the attacker needed
A user account on the forum; victim is an administrator; admin has an active backend session; admin opens the malicious private message
How it was found
- Create a user account on the target forum.
- Craft a private message containing a malicious [video] BBCode with a URL-encoded [url] BBCode that injects an onload event handler.
- Send the private message to an administrator.
- The administrator opens the private message while logged into the backend, triggering the JavaScript.
- The JavaScript exploits the admin panel's stylesheet import to create a PHP file with a truncated filename.
- The attacker accesses the PHP shell in the cache directory to execute arbitrary code.
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.
MyBB is forum software. A user could send a private message that contained special formatting codes; due to a parsing mistake, this let the attacker run their own JavaScript in the administrator's browser. Separately, an administrator could create stylesheet files, and a flaw in how filenames were stored allowed creating a file with a .php extension, which could be executed as code on the server. Together, these let an attacker take over the forum.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.