Skip to main content

CVE-2025-4171: WordPress WZ Followed Posts XSS Vulnerability

CVE-2025-4171 is a stored XSS flaw in the WZ Followed Posts WordPress plugin that enables authenticated attackers to inject malicious scripts. This article covers the technical details, affected versions, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-4171 Overview

CVE-2025-4171 is a Stored Cross-Site Scripting (XSS) vulnerability [CWE-79] in the WZ Followed Posts – Display what visitors are reading plugin for WordPress. The flaw affects all versions up to and including 3.1.0. The plugin's wfp shortcode fails to sanitize user-supplied attributes and escape output. Authenticated users with contributor-level access or above can inject arbitrary JavaScript into pages. The injected scripts execute in the browser of any visitor who views the affected page.

Critical Impact

Authenticated contributors can inject persistent JavaScript via the wfp shortcode, enabling session theft, redirects, and administrator account takeover when privileged users visit the poisoned content.

Affected Products

  • WZ Followed Posts – Display what visitors are reading (WordPress plugin)
  • All versions up to and including 3.1.0
  • WordPress sites allowing contributor-level or higher registrations

Discovery Timeline

  • 2025-05-07 - CVE-2025-4171 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-4171

Vulnerability Analysis

The vulnerability resides in the plugin's wfp shortcode handler. The shortcode accepts user-supplied attributes that are rendered back into page HTML without adequate sanitization or output escaping. A contributor can embed the shortcode in a draft post with crafted attribute values containing JavaScript payloads. When an administrator previews the draft or any visitor loads the published page, the script executes under the site's origin.

Stored XSS in a WordPress context typically escalates to full site compromise. Attacker-controlled JavaScript running in an administrator session can create new admin users, modify plugin files, or exfiltrate authentication cookies. The scope-changed CVSS metric reflects this cross-privilege impact.

Root Cause

The plugin uses insufficient input sanitization on shortcode attributes and omits proper output escaping functions such as esc_attr() or esc_html() when rendering shortcode output. User-controlled strings reach the DOM as executable HTML rather than inert text.

Attack Vector

Exploitation requires an authenticated account with the WordPress contributor role or higher. The attacker inserts the wfp shortcode with a malicious attribute into post content. No user interaction beyond normal page browsing is required for the payload to trigger. See the Wordfence Vulnerability Report for additional technical context.

Detection Methods for CVE-2025-4171

Indicators of Compromise

  • Posts or pages containing [wfp ...] shortcode entries with attribute values that include <script>, onerror=, javascript:, or encoded script fragments.
  • Unexpected new administrator accounts, plugin installations, or modifications to wp-options following contributor activity.
  • Outbound HTTP requests from editor or visitor sessions to unknown third-party domains loading remote JavaScript.

Detection Strategies

  • Query the wp_posts table for post_content entries containing the wfp shortcode and inspect attribute values for script syntax.
  • Review WordPress audit logs for shortcode insertions by contributor-role accounts, especially on recently created or modified drafts.
  • Monitor browser Content Security Policy (CSP) violation reports originating from authenticated admin sessions.

Monitoring Recommendations

  • Enable WordPress activity logging for post edits, user role changes, and plugin modifications.
  • Alert on creation of new users with the administrator role outside of change windows.
  • Baseline outbound requests from /wp-admin/ sessions and alert on connections to unexpected destinations.

How to Mitigate CVE-2025-4171

Immediate Actions Required

  • Update the WZ Followed Posts plugin to a version above 3.1.0 once the vendor publishes a patched release.
  • Audit all posts and pages for existing wfp shortcodes with suspicious attributes and remove any confirmed payloads.
  • Review contributor-level and higher accounts for unauthorized registrations and reset credentials where accounts are suspect.

Patch Information

The vendor committed changes referenced in the WordPress Plugin Changeset 3287192. Site administrators should upgrade to the fixed release and verify the plugin version through the WordPress Dashboard.

Workarounds

  • Deactivate the WZ Followed Posts plugin until a patched version is installed.
  • Restrict contributor registrations and require administrator approval for any role above subscriber.
  • Deploy a Web Application Firewall (WAF) rule to block shortcode attributes containing script tags or event handler syntax.
bash
# Disable the vulnerable plugin via WP-CLI until patched
wp plugin deactivate where-did-they-go-from-here

# Audit posts for the vulnerable shortcode
wp db query "SELECT ID, post_title FROM wp_posts WHERE post_content LIKE '%[wfp%'"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.