Skip to main content
Vulnerability Database/CVE-2025-31590

CVE-2025-31590: WP Date and Time Shortcode XSS Vulnerability

CVE-2025-31590 is a stored XSS vulnerability in WP Date and Time Shortcode plugin that allows attackers to inject malicious scripts into web pages. This post explains its impact, affected versions, and mitigation steps.

Published:

CVE-2025-31590 Overview

CVE-2025-31590 is a stored Cross-Site Scripting (XSS) vulnerability in the Denra.com WP Date and Time Shortcode plugin for WordPress. The flaw affects all plugin versions up to and including 2.6.7. It stems from improper neutralization of user-supplied input during web page generation, classified as [CWE-79]. Authenticated attackers with low privileges can inject malicious scripts that execute in the browsers of other users viewing affected pages. Exploitation requires user interaction and can cross security scopes, impacting confidentiality, integrity, and availability of affected WordPress installations.

Critical Impact

Authenticated attackers can inject persistent JavaScript payloads that execute in administrator and visitor browsers, enabling session hijacking, credential theft, and unauthorized administrative actions.

Affected Products

  • Denra.com WP Date and Time Shortcode plugin for WordPress
  • All versions from n/a through 2.6.7
  • WordPress sites with the wp-date-and-time-shortcode plugin installed and activated

Discovery Timeline

  • 2025-03-31 - CVE-2025-31590 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-31590

Vulnerability Analysis

The vulnerability resides in how the WP Date and Time Shortcode plugin processes user-supplied input before rendering it within WordPress pages. The plugin fails to properly sanitize or encode input passed through shortcode attributes or associated configuration fields. Injected payloads persist in the WordPress database and execute whenever an affected page loads in a user's browser.

Stored XSS is particularly damaging in WordPress environments because malicious scripts execute in the context of the site origin. This allows attackers to access session cookies, perform actions on behalf of authenticated administrators, and pivot toward full site compromise. The vulnerability affects all plugin versions up to and including 2.6.7.

Root Cause

The root cause is missing output encoding and insufficient input validation on shortcode parameters processed by the plugin. WordPress provides sanitization APIs such as esc_html(), esc_attr(), and wp_kses(), but the plugin does not apply them consistently before echoing user-controlled data into HTML contexts. This omission allows script tags and event handler attributes to survive into rendered output.

Attack Vector

Exploitation requires an authenticated user with at least contributor-level access to inject a malicious shortcode payload into a post, page, or plugin configuration. When another user, including administrators, views the affected content, the injected JavaScript executes in their browser session. The scope change indicates the payload can affect resources beyond the initial vulnerable component, such as the WordPress admin interface.

Refer to the Patchstack XSS Vulnerability Report for additional technical context.

Detection Methods for CVE-2025-31590

Indicators of Compromise

  • Unexpected <script> tags, javascript: URIs, or DOM event handlers (onerror, onload, onclick) stored within WordPress post content or plugin option tables
  • Outbound HTTP requests from visitor browsers to attacker-controlled domains originating from pages using the wp-date-and-time-shortcode plugin
  • Unauthorized administrator account creation or privilege changes following visits to pages with embedded date and time shortcodes

Detection Strategies

  • Audit the wp_posts and wp_options tables for shortcode instances containing HTML tags, script content, or encoded payloads such as %3Cscript%3E
  • Deploy a Web Application Firewall (WAF) rule set that inspects POST requests to wp-admin/post.php and shortcode-processing endpoints for XSS payload signatures
  • Enable WordPress activity logging to correlate contributor-level content changes with subsequent administrator session anomalies

Monitoring Recommendations

  • Monitor browser console errors and Content Security Policy (CSP) violation reports for pages rendering the affected shortcode
  • Track authentication events for administrator accounts following suspicious content edits by lower-privileged users
  • Alert on plugin file integrity changes and unexpected outbound network connections from the WordPress host

How to Mitigate CVE-2025-31590

Immediate Actions Required

  • Identify all WordPress sites running the WP Date and Time Shortcode plugin at version 2.6.7 or earlier and deactivate the plugin until a patched release is confirmed
  • Review all posts and pages using the plugin's shortcodes and remove any content containing script tags or suspicious HTML attributes
  • Rotate administrator credentials and invalidate active sessions if evidence of exploitation exists

Patch Information

At the time of publication, the CVE record indicates the vulnerability affects all versions up to and including 2.6.7. Consult the Patchstack XSS Vulnerability Report and the WordPress plugin repository for the latest patched version and update immediately when available.

Workarounds

  • Deactivate and remove the WP Date and Time Shortcode plugin until a fix is deployed
  • Restrict content editing privileges so only trusted, high-privilege users can publish or edit posts containing shortcodes
  • Deploy a WordPress-aware WAF with XSS filtering rules to block payload injection attempts targeting shortcode parameters
bash
# Configuration example: deactivate the vulnerable plugin via WP-CLI
wp plugin deactivate wp-date-and-time-shortcode
wp plugin uninstall wp-date-and-time-shortcode

# Audit stored content for injected script payloads
wp db query "SELECT ID, post_title FROM wp_posts WHERE post_content LIKE '%<script%' OR post_content LIKE '%javascript:%';"

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

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.