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

CVE-2025-23877: Nite Shortcodes Stored XSS Vulnerability

CVE-2025-23877 is a stored cross-site scripting flaw in the Nite Shortcodes WordPress plugin that enables attackers to inject malicious scripts. This article covers technical details, affected versions, and mitigation.

Published:

CVE-2025-23877 Overview

CVE-2025-23877 is a stored Cross-Site Scripting (XSS) vulnerability in the nitethemes Nite Shortcodes WordPress plugin. The flaw affects all versions up to and including 1.0. The plugin fails to properly neutralize user-supplied input during web page generation, allowing authenticated attackers with low privileges to inject persistent JavaScript payloads. Injected scripts execute in the browser context of any user who views the affected page, including administrators. The issue is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation).

Critical Impact

Authenticated contributors or higher can plant persistent JavaScript that executes against site visitors and administrators, enabling session theft, forced administrative actions, and stored malware delivery.

Affected Products

  • nitethemes Nite Shortcodes WordPress plugin versions through 1.0
  • WordPress sites running the nite-shortcodes plugin
  • Any site administrator or visitor rendering pages containing injected shortcode output

Discovery Timeline

  • 2025-01-16 - CVE-2025-23877 published to the National Vulnerability Database
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-23877

Vulnerability Analysis

The vulnerability resides in how the Nite Shortcodes plugin processes shortcode attributes and content before rendering them into WordPress pages. Input passed through affected shortcodes is stored in the database and later reflected into HTML output without adequate escaping or sanitization. Because the payload persists server-side, every subsequent page render re-executes the attacker-controlled JavaScript against each viewer.

Exploitation requires an authenticated session with post-editing privileges and user interaction from a victim who views the compromised page. The scope change captured in the CVSS vector indicates that a successful attack impacts resources beyond the vulnerable component, such as the WordPress administrative interface accessed under a different security authority.

Root Cause

The plugin does not apply WordPress escaping primitives such as esc_attr(), esc_html(), or wp_kses() to shortcode attribute values and body content before emitting them into the HTML response. Server-side sanitization on save is also insufficient, so raw markup containing <script> tags, event handlers, or javascript: URIs is preserved verbatim.

Attack Vector

An attacker with contributor-level or higher access authors a post or page that embeds a malicious shortcode carrying a crafted attribute payload. When an administrator previews or publishes the content, or when a public visitor loads the resulting page, the injected script runs with the victim's privileges. Consequences include session cookie exfiltration, forced creation of privileged accounts through the WordPress REST API, and drive-by redirection to attacker infrastructure.

No verified proof-of-concept code has been published. Refer to the Patchstack advisory for additional technical context.

Detection Methods for CVE-2025-23877

Indicators of Compromise

  • Post or postmeta records containing <script>, onerror=, onload=, or javascript: inside Nite Shortcodes attributes
  • Unexpected outbound requests from browser sessions to unfamiliar domains after rendering pages that use the nite-shortcodes plugin
  • New WordPress administrator accounts or role changes created shortly after content authored by a contributor was published

Detection Strategies

  • Query the wp_posts table for shortcode patterns such as [nite_ followed by suspicious HTML attributes or script markers
  • Enable Content Security Policy (CSP) reporting to capture inline script violations on WordPress front-end pages
  • Review WordPress audit logs for content edits from low-privilege accounts followed by administrator page views

Monitoring Recommendations

  • Alert on additions or changes to files under wp-content/plugins/nite-shortcodes/ on production hosts
  • Monitor web server access logs for administrative endpoint access immediately following contributor-authored content publication
  • Track REST API calls to /wp/v2/users and /wp-admin/admin-ajax.php originating from administrator session cookies

How to Mitigate CVE-2025-23877

Immediate Actions Required

  • Deactivate and remove the Nite Shortcodes plugin until a patched release is confirmed by the vendor
  • Audit existing posts and pages for embedded nite-shortcodes markup and strip any suspicious HTML or JavaScript
  • Rotate WordPress administrator credentials and invalidate active sessions if the plugin has been in use

Patch Information

No fixed version has been published at the time of the NVD advisory. The plugin is affected through version 1.0 with no upstream patch identified. Consult the Patchstack advisory for the latest remediation status.

Workarounds

  • Restrict content authoring capabilities so that only trusted administrators can publish posts containing shortcodes
  • Deploy a web application firewall (WAF) rule that blocks HTTP request bodies containing <script> or event-handler attributes inside nite- shortcode parameters
  • Enforce a strict Content Security Policy that disallows inline scripts and untrusted external script sources on the WordPress front end
bash
# Configuration example: strict CSP header via Apache to limit XSS impact
Header always set Content-Security-Policy "default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'self'"

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

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

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.