Skip to content
XSS Write-up Beginner

CVE-2025-31080 WordPress HTML Forms Plugin <= 1.5.1 Vulnerable to

The HTML Forms WordPress plugin stored the value of the Referer header from a form submission without sanitising it, so an attacker could place script content there. When an administrator later viewed the entry and clicked the referer link, the script ran in the admin's browser and could steal cookies.

Abhinav Porwal Follow

Published on abhinav-porwal.medium.com

A serious security vulnerability has been discovered in the WordPress HTML Forms Plugin affecting versions <= 1.5.1, exposing over 10,000 websites to Stored Cross-Site Scripting (XSS) attacks.

Abhinav Porwal, on abhinav-porwal.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

Likely the plugin stored the user-controlled Referer header and rendered it as a link without sanitising or escaping it.

Impact

An unauthenticated attacker could run script in an administrator's browser, which could lead to cookie theft or other malicious actions.

What the attacker needed

Target runs HTML Forms <= 1.5.1; attacker can submit a form; admin clicks the referer link

The fix

The plugin was fixed in version 1.5.2, and the report also advises sanitising header input and adding a Content Security Policy.

How it was found

  1. Open a form that uses the HTML Forms plugin.
  2. Fill in the required fields and intercept the submission request.
  3. Change the Referer header to contain script content.
  4. Submit the form.
  5. Wait for an administrator to review the entry and click the referer link, at which point the script runs.

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.

A form on a website can record where a visitor came from, using a value called the Referer header that the browser sends. This plugin saved that value and later showed it as a clickable link to the site administrator without cleaning it first. Because the saved value could contain script, the administrator's browser would run that script when the link was clicked, letting an attacker act as the administrator.

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.