On this page

Reflected XSS Vulnerability Image

Plugin Name Shortcodes Blocks Creator Ultimate
Type of Vulnerability Cross-Site Scripting (XSS)
CVE Number CVE-2024-12167
Urgency Medium
CVE Publish Date 2026-03-24
Source URL CVE-2024-12167

Reflected XSS in Shortcodes Blocks Creator Ultimate (≤ 2.2.0) — What WordPress Site Owners Must Do Right Now

Date: 2026-03-24
Author: WP-Firewall Security Team
Tags: WordPress, WAF, XSS, plugin-security, incident-response


Summary
A reflected Cross-Site Scripting (XSS) vulnerability (CVE-2024-12167) was disclosed in the Shortcodes Blocks Creator Ultimate WordPress plugin (versions ≤ 2.2.0). The issue revolves around unsafe reflection of values related to WordPress nonces (_wpnonce) and can be weaponized to execute JavaScript in the context of a victim’s browser. This post explains the technical details, realistic attack scenarios, detection and mitigation steps, and long-term hardening recommendations — from the perspective of our WP-Firewall security team.


Why this matters (short version)

Reflected XSS is one of the most common web vulnerabilities. In WordPress contexts it is particularly dangerous when it can be used against privileged users (site admins, editors) because it can lead to account takeover, option changes, plugin/theme file modifications, or installation of backdoors. Even if a vulnerability seems to require “user interaction” (clicking a link, visiting a crafted page), real-world attackers frequently craft social-engineering lures or inject links into third-party content that administrators might open.

For any website using Shortcodes Blocks Creator Ultimate at version 2.2.0 or below, assume risk until you have implemented mitigation. If you can’t patch immediately, follow the layered mitigations below.


What the vulnerability is (technical summary)

  • Vulnerability type: Reflected Cross-Site Scripting (XSS).
  • Affected component: Shortcodes Blocks Creator Ultimate WordPress plugin (≤ 2.2.0).
  • CVE: CVE-2024-12167
  • Root cause (high level): Unsanitized user-controlled input — specifically values associated with the WordPress nonce parameter (_wpnonce) — are reflected back to the user (in some AJAX response or page) without proper escaping or encoding. That reflection enables injection of script payloads that execute in the victim’s browser.
  • Access required: The vulnerability can be triggered by unauthenticated actors creating crafted URLs. Successful attack impact is higher if an authenticated or privileged user (e.g. admin) is induced to visit the crafted link.
  • Typical impact: Execution of arbitrary JavaScript in the victim’s browser (session theft via cookies, CSRF-style actions, administrative account takeover, persistent changes if chained with other vulnerabilities).

Important nuance: many reflected XSS reports indicate the payload is delivered via a response that requires a privileged user to perform an action (e.g., click a link inside the admin). A typical attack flow is an attacker sends a crafted URL to an admin; the admin clicks it; malicious script executes in the admin’s session and performs privileged actions.


How attackers will likely exploit it (realistic scenarios)

  1. Phishing admin users: Attacker crafts a convincing admin-focused email with a link containing the XSS payload in parameters (often URL-encoded). If an admin follows the link while logged in, the script runs and can trigger actions like exporting users, adding an admin user, or injecting malicious posts.
  2. Drive-by via third-party content: If an attacker can place a link in a third-party site or comment that an admin later clicks (or if an attacker compromises a partner site), this can trigger XSS.
  3. Chaining with other bugs: Attackers may use the reflected XSS to execute scripts that reach out to internal endpoints (e.g., perform AJAX calls) and leverage authentication cookies or REST API endpoints to perform persistent changes.
  4. Session theft & privilege escalation: The injected script can send cookies or nonces to an attacker-controlled server, enabling session hijacking or replay of admin actions.

Indicators of compromise (what to look for)

When investigating whether an attack occurred, check for:

  • Unfamiliar admin accounts created around the time of suspicious activity.
  • Post/page content altered by an admin user or unknown user.
  • Plugin/theme files modified (upload timestamps or changed content).
  • Unknown scheduled tasks (cron entries) or outbound connections to unknown domains from the site.
  • Access logs showing requests with unusual query parameters containing encoded characters (%3C, %3E, %3Cscript%3E) or long strings that look like payloads.
  • Admin sessions that include IP addresses or user agents inconsistent with normal usage.
  • Alerts from malware scanners indicating injected JavaScript in pages or posts.
  • Unexpected changes to options in wp_options (e.g., site_url changes, new redirect rules).

Search your HTTP access logs for patterns like:

  • Requests containing _wpnonce= with unexpected values or payload-like content.
  • Encoded script tags: %3Cscript%3E, \x3Cscript\x3E, <script>.
  • Unusual POST/GET params with long base64 strings, HTML tags, or event handlers (onload, onclick).

Immediate recommended actions (priority list)

If you manage WordPress sites with this plugin installed, do the following immediately — in this order:

  1. Confirm plugin version
    Check the plugin page in wp-admin or wp-content/plugins to confirm version. If it’s ≤ 2.2.0, treat it as vulnerable.
  2. If a secure plugin update is available, update immediately
    Always test in staging first when possible. If no official patch is yet available, proceed with mitigations below.
  3. Apply WAF (virtual/temporary patch)
    Block exploit patterns with a WAF rule. This prevents most automated and opportunistic attacks. A practical WAF rule can block requests where _wpnonce parameter values contain <, >, script, or encoded forms.
  4. Limit administrative access
    Restrict wp-admin by IP (if feasible), VPN, or HTTP auth.
    Enforce two-factor authentication (2FA) for all admin accounts.
    Revoke sessions you don’t recognize (Users → All Users → Session management plugins or use database query to delete sessions).
  5. Scan for indicators and rollback suspicious changes
    Use your malware scanner to search for injected scripts in posts, pages, theme/plugin files, and uploads.
    Revert any suspicious modifications from backups or version-controlled copies.
  6. Remove or deactivate the plugin (if update unavailable and mitigation cannot be applied)
    If the plugin is non-critical for site functionality, deactivate and remove it until it’s patched.
  7. Harden admin users
    Rotate passwords for all admin accounts. Force password resets for privileged accounts.
    Disable unnecessary admin accounts and check for accounts with elevated privileges.
  8. Monitor logs and traffic
    Increase logging sensitivity and retain logs for deeper forensic analysis.
    Watch for repeated requests that match the exploit patterns.

Example detection signatures and WAF rules

Below are sample rules and patterns you can use within a WAF to block exploit attempts. These are illustrative — adapt them to your WAF platform syntax.

Note: Always test rules in “monitor” mode before blocking so you don’t create false positives that break legitimate functionality.

  1. Generic RegExp to detect script tags or encoded forms in _wpnonce:
(?i)(_wpnonce=)([^&]*)(%3C|%3c|<|&lt;|%253C|script|%3E|%3e|>|&gt;)

If the tool supports rule building, a rule could be:

  • Condition: Query string contains _wpnonce
  • AND: _wpnonce value matches regex for < or script or encoded forms.
  • Action: Block or challenge (CAPTCHA/JS challenge).
  1. ModSecurity example (conceptual):
# Block if _wpnonce param includes suspicious tokens
SecRule REQUEST_URI|ARGS_NAMES|ARGS "@rx _wpnonce" "phase:2,chain,deny,id:100101,log,msg:'Reflected XSS attempt via _wpnonce parameter'"
    SecRule ARGS:_wpnonce "@rx (?i)(%3C|%3c|<|%3E|%3e|>|&lt;|&gt;|script|onload|onerror|eval|document\.cookie)" "t:none,log,deny,status:403"
  1. Block encoded XSS payloads in query strings:
SecRule QUERY_STRING "@rx (?i)(%3Cscript%3E|%253Cscript%253E|%3Cscript|%3C%2Fscript%3E)" "id:100102,phase:2,deny,log,msg:'Encoded script tag in query string'"
  1. Minimal nginx location-level protection (conceptual):
if ($request_uri ~* "_wpnonce=.*(%3C|%3c|<|%3E|%3e|>|script)") {
    return 403;
}
  1. Block suspicious referrers or user agents when calling sensitive admin endpoints:
    – If an AJAX endpoint is only used by admin dashboards, block requests to it from outside known admin origin domains.

Important: For large or multi-tenant sites, ensure any blocking rules are narrowly scoped to avoid breaking legitimate admin flows.


Remediation checklist — step-by-step

  1. Inventory
    List all sites using the plugin and their versions. Prioritize high-value sites (ecommerce, membership, high-traffic).
  2. Patch (if available)
    Update the plugin as soon as a patch is published. Follow plugin author guidance.
  3. WAF / Virtual patch
    Deploy WAF rules to block exploit vectors. Keep rules simple, targeted, and logged.
    Use progressive enforcement: monitor -> challenge -> block.
  4. Access controls
    Restrict access to /wp-admin and /wp-login.php via IP allowlist, VPN, or HTTP authentication if possible.
    Enforce strong passwords and 2FA for all privileged users.
  5. Audit & restore
    Perform a malware scan and file integrity check. Compare plugin/theme files to original versions in repository.
    Restore compromised files from a clean backup if necessary.
  6. Rotate secrets
    Reset admin account passwords. Regenerate API keys, integration secrets, and tokens used by the site if there’s any chance of exposure.
  7. Monitor
    Increase alerting for suspicious events (admin login from new IP, file changes).
    Monitor outgoing traffic for exfiltration.
  8. Communication
    If you are a hosting provider or manage client sites, notify affected customers promptly with recommended steps.

For developers: Good coding practices to avoid nonce-related reflections

If you’re a plugin or theme developer, these items will prevent the type of reflected XSS described here:

  1. Never echo untrusted input back to the browser without escaping.
    Use sanitization when accepting input.
    Escape on output: esc_html(), esc_attr(), esc_textarea(), or wp_kses() depending on context.
  2. Use WordPress escaping helpers for HTML attributes and content:
    esc_attr() for attribute values
    esc_html() for HTML text nodes
    esc_js() for inline JavaScript insertion (preferably avoid inline JS)
    wp_kses_post() for allowed HTML in post content
  3. Validate and verify nonces server-side using wp_verify_nonce()
    But remember: a nonce value is not input content; don’t assume it’s safe to reflect it directly.
  4. When returning JSON responses (AJAX), JSON-encode values and avoid embedding HTML directly into JSON.
    Use wp_send_json_success() / wp_send_json_error() with properly sanitized content.
  5. Prefer POST for sensitive operations and avoid reflecting parameters back into GET-based responses.
  6. Use Content Security Policy (CSP) headers to reduce impact of reflected XSS:
    report-only first; then enforce once you’ve tested.
  7. Educate QA/test teams to include XSS payloads (encoded/unencoded) in inputs as part of test plans.

Recommended incident response flow (if you suspect exploitation)

  1. Isolate
    Temporarily take the site into maintenance mode or restrict admin access to prevent further admin-driven exploitation.
  2. Contain
    Apply WAF rules to block exploit attempts.
    Revoke active admin sessions and force password resets.
  3. Investigate
    Collect web server access logs, error logs, wp-admin audit logs, and database change logs.
    Look for suspicious requests, especially with _wpnonce parameters or unusual encoded payloads.
  4. Eradicate
    Remove injected scripts from content and files.
    Restore clean copies of compromised files from pre-incident backups.
  5. Recover
    Re-enable services once sanitized and confirm normal behavior.
    Continue heightened monitoring for at least 30 days.
  6. Post-incident
    Perform root cause analysis and apply process changes (e.g., stricter patching policy, better staging).
    Communicate with stakeholders and users as required by policy or regulations.

Hardening and long-term prevention (beyond this vulnerability)

  • Keep WordPress core, themes, and plugins up-to-date on a reliable schedule.
  • Use staging sites for plugin upgrades and test for compatibility before production deployment.
  • Implement Role-Based Access Control: grant the minimum privileges required for administrative tasks.
  • Enforce 2FA and strong password policies for privileged accounts.
  • Enable file integrity monitoring (detect file modifications in wp-content, wp-includes).
  • Audit and remove unused plugins and themes.
  • Implement regular backups with off-site storage and test restore procedures.
  • Use a layered security approach: host-level hardening, application-level WAF, and runtime monitoring.

Practical examples: How to harden a vulnerable site quickly

  1. Short-term WAF rule (example):
    Block requests where _wpnonce includes any of the following tokens: <, >, script, onload, onerror, eval, document.cookie, or common encoded forms.
  2. Limit admin access by IP:
    If you have static IP addresses from your team, restrict access to /wp-admin and /wp-login.php to those IPs. Add exceptions for legitimate services (e.g., monitoring).
  3. Add a Content Security Policy (CSP) header:
    A strict CSP significantly reduces the ability of reflected XSS to load external scripts or exfiltrate data.
    Start with report-only mode, review reports, then enforce.
  4. Sanitize inputs in custom or third-party code:
    If your site or consultants have custom code that includes or interacts with this plugin, ensure that any data passed through or rendered to the browser is sanitized/escaped.
  5. Disable auto-render of admin notices that include untrusted values:
    Many plugins display admin notices that reflect GET parameters. Audit admin notice generation code and escape accordingly.

Monitoring & log patterns to enable alerting

Set up alerts for:

  • Requests with _wpnonce containing %3C, %3E, %3Cscript or script tokens.
  • POST requests to admin endpoints coming from unusual IP addresses or geolocations.
  • Mass requests to endpoints that include query strings longer than usual (indicating payload delivery).
  • Admin login from new IPs within short timeframe of suspicious GET requests.

Sample log search (conceptual):

request:/wp-admin* AND query._wpnonce:/.*(%3C|%3E|<|>|\bscript\b).*/i

Trigger: send alert to security team and temporarily block the IP or present JS challenge.


Developer guidance — secure patterns for handling _wpnonce

  • Nonces are for verifying intent, not for data transport. Don’t use the nonce value itself as content. If you must echo a nonce value for debugging, escape it properly and remove that output in production.
  • When building admin pages that accept parameters, sanitize all inputs with appropriate filters and escape outputs using WordPress helpers.
  • Where the plugin prints admin notices or returns HTML via AJAX, do not directly echo query parameters. Always sanitize, validate, and escape.

Example (safe) output in plugin admin page:

<?php
// Bad: echoing raw GET value
echo '<div>' . $_GET['some_param'] . '</div>';

// Good: sanitize and escape
$param = isset($_GET['some_param']) ? sanitize_text_field(wp_unslash($_GET['some_param'])) : '';
echo '<div>' . esc_html($param) . '</div>';

For AJAX endpoints:

  • Use check_ajax_referer() to verify nonce intent.
  • For JSON responses, use wp_send_json_success( array( 'data' => $safe_value ) );

How WP-Firewall protects you (short technical note)

As a WordPress security provider, we implement proactive detection and virtual patching to prevent attacks like the reflected XSS described here. Our approach follows a layered model:

  • Rule-based blocking that targets exploit patterns (including encoded payloads targeting nonce parameters).
  • Runtime detection of anomalous admin activity and automatic session containment.
  • Malware scanning to detect injected scripts and modified files.
  • Security hardening guidance for plugin usage, admin access, and configuration.

If you are using our free layer, basic WAF protections and malware scans will block a large percentage of automated exploit attempts, and we provide simple step-by-step remediation guidance.


Secure your site for free with WP-Firewall Basic

If you want a quick, no-cost way to reduce your exposure while you plan remediation, try WP-Firewall Basic (free). The Basic plan gives you essential protection: a managed firewall, unlimited bandwidth, a Web Application Firewall tuned for WordPress, a malware scanner, and mitigation for OWASP Top 10 risks. It’s an easy way to add an immediate virtual patch layer and improve your detection capability without changing your site configuration. Sign up for the free plan here: https://my.wp-firewall.com/buy/wp-firewall-free-plan/

(If you need automatic malware removal, IP allow/deny controls, or virtual patching with prioritized rules for plugin vulnerabilities, consider stepping up to the paid plans.)


FAQs

Q: If the plugin is deactivated, am I safe?
A: Deactivating and removing the plugin removes the immediate attack surface. However, if a site was previously exploited, deactivation alone does not clean injected content or backdoors. Always scan and verify.

Q: Can attackers exploit the vulnerability via search engines?
A: Only if an admin/user clicks a crafted link while authenticated. However, attackers can distribute such links in emails, partner pages, or comments. Treat any external link to the admin as risky if the plugin is vulnerable.

Q: Are nonces supposed to be secret?
A: No. Nonces are not secret tokens like passwords; they’re short-lived tokens to verify intent. They should never be used as a vehicle for data to be reflected back to users without proper sanitization/escaping.


Final thoughts (practical risk assessment)

Reflected XSS is a high-probability, medium-to-high-impact issue when it can affect administrators. Because it can be triggered via crafted URLs and social engineering, this is precisely the sort of vulnerability that often shows up in mass-exploit attempts. If your site uses the affected plugin version, treat it as urgent: patch if available, and if not, apply WAF rules, limit admin access, and scan for compromise.

Security is not a one-off task. Combine timely patching, a layered defense (WAF + hardening + monitoring), and responsive incident processes to reduce the chance an exploit turns into a full compromise.

If you want help implementing the protections above or would like us to review a specific incident or log output, contact our security operations team — we can help you reduce the attack window while working with you on a full remediation roadmap.


References & further reading


WP-Firewall Security Team
We secure WordPress sites by combining expert analysis, managed WAF rules, and practical remediation guidance.

Latest WordPress Plugin Vulnerabilities · Plugin Vulnerabilities