Skip to content
XSS Write-up Intermediate

Stored XSS to Admin in Unauthenticated-WordPress

The All in One SEO Pack plugin for WordPress stores unsanitised User-Agent or Referer headers from blocked bot requests in its logs, leading to stored XSS. An unauthenticated attacker can inject JavaScript that executes when an administrator views the blocked bots log page, potentially creating a new admin account.

medium.com

Published on medium.com

The All in One SEO Pack plugin, a widely-used SEO tool for WordPress with over 1 million active installs, has a critical security vulnerability in one of its feature. This vulnerability, identified as Unauthenticated Stored Cross-Site Scripting (XSS), allows attackers to inject malicious JavaScript code through the…

c0d3x27, on medium.com

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 plugin fails to sanitise or escape the User-Agent and Referer headers before storing them in the blocked bots log HTML page.

Impact

An unauthenticated attacker could execute arbitrary JavaScript in an administrator's browser and create a new administrative account, though the text notes that HttpOnly and Secure cookie flags prevent direct session cookie theft.

What the attacker needed

Track Blocked Bots setting enabled; victim (admin) visits the log page; no authentication required

The fix

The plugin should properly sanitise or escape the stored User-Agent and Referer headers before rendering them in the blocked bots log page.

How it was found

  1. Enable the Track Blocked Bots setting (assumed to be on).
  2. Send a request with a malicious User-Agent or Referer header containing an XSS payload.
  3. The request is blocked and the payload is stored in the logs.
  4. An administrator visits the log page, executing the stored payload.

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.

This is a stored cross-site scripting (XSS) bug. The plugin saves the User-Agent or Referer header from blocked bot requests without cleaning it, so if an attacker puts JavaScript code in that header, the code is saved and later runs in the browser of any admin who views the log page. Because the attacker does not need to log in, anyone can trigger it.

What is XSS?

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

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.