AMP for WP – Accelerated Mobile Pages <= 1.1.22 - Unauthenticated Stored Cross-Site Scripting via Comment Anchor Attributes

High 7.2 CWE-79Fixed in 1.1.23
ID
WPSEC-2026-4379
Plugin
AMP for WP – Accelerated Mobile Pages (accelerated-mobile-pages)
Affected
from 1.1.17 before 1.1.23
Remediation
Update to 1.1.23 or later.
CVSS 3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N
Weakness
CWE-79
Usage
Plugin Low · Affected versions Low among sites WPSec scans, 2026-12-03
Attack surface
AMP for WP – Accelerated Mobile Pages on WPSec AttackSurface
Fix released
Published

Description

The AMP for WP – Accelerated Mobile Pages plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the AMP anchor rewriting of comment content in all versions from 1.1.17 up to, and including, 1.1.22. This is due to how ampforwp_remove_unwanted_code() and ampforwp_sanitize_anchor_opening_tag() handle anchors. They pick out any <a> tag whose attribute values contain the text 'label=', re-serialize it with DOMDocument::saveHTML(), and then cut the result at the first '>'. HTML entities in attribute values come back out as raw angle brackets, so the rebuilt tag no longer ends where the original attribute did. This makes it possible for unauthenticated attackers to inject arbitrary web scripts through comment links. The scripts run whenever a user opens the AMP version of the affected page.

References

Published by WPSec. Provided as is, without warranty. Corrections: contact us.

This advisory as JSON, OSV or Markdown · All advisories: JSON, OSV, RSS

License: CC BY 4.0