Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2025-23943 Overview
CVE-2025-23943 is a stored Cross-Site Scripting (XSS) vulnerability in the aruvi PDF.js Shortcode plugin for WordPress (pdfjs-shortcode). The flaw stems from improper neutralization of user-supplied input during web page generation, classified under [CWE-79]. All plugin versions up to and including 1.0 are affected. An authenticated attacker with low privileges can inject malicious JavaScript that is stored by the application and executed in the browsers of other users who view the affected page.
Critical Impact
Authenticated contributors or similar low-privileged WordPress users can inject persistent JavaScript payloads that execute in the context of site visitors and administrators, enabling session theft, redirect attacks, and administrative action abuse.
Affected Products
- WordPress plugin pdfjs-shortcode (PDF.js Shortcode) by aruvi
- All versions from initial release through 1.0
- WordPress sites running the plugin with user content submission enabled
Discovery Timeline
- 2025-01-16 - CVE-2025-23943 published to the National Vulnerability Database
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-23943
Vulnerability Analysis
The PDF.js Shortcode plugin registers a WordPress shortcode that renders PDF files inside posts and pages using the PDF.js renderer. The plugin fails to sanitize or encode shortcode attribute values before echoing them into the generated HTML output. An authenticated user with permission to publish posts or submit shortcode content can embed JavaScript payloads inside shortcode attributes. The payloads persist in the WordPress database and execute whenever any user renders the affected post.
Because the attack is stored, each page load delivers the payload to new victims without further attacker interaction. The CVSS vector indicates a scope change, meaning injected scripts execute in the browser security context of other users, including site administrators.
Root Cause
The root cause is missing output encoding and input validation in the plugin's shortcode handler. User-controlled attribute values flow directly into HTML attribute or element contexts without passing through WordPress sanitization helpers such as esc_attr(), esc_html(), or wp_kses(). This is a textbook [CWE-79] violation in WordPress shortcode processing.
Attack Vector
Exploitation requires network access to the WordPress site and a low-privileged authenticated account with content-publishing rights. The attacker inserts the vulnerable shortcode with a crafted attribute containing JavaScript. The payload is saved to the wp_posts table. When another user, including an administrator, views the containing post, the injected script executes under the site's origin. Victim interaction such as clicking a link or loading the post is required, aligning with the UI:R component of the CVSS vector.
See the Patchstack XSS Vulnerability Report for additional advisory context.
Detection Methods for CVE-2025-23943
Indicators of Compromise
- Shortcode entries in wp_posts content containing <script>, onerror=, onload=, or javascript: strings within [pdfjs-viewer] or similar pdfjs-shortcode attributes
- Outbound requests from administrator browser sessions to unknown third-party domains after viewing posts containing the shortcode
- Unexpected creation of administrator accounts or modification of user roles following page views
Detection Strategies
- Query the WordPress database for stored shortcode content containing HTML event handlers or script tags embedded in pdfjs-shortcode attribute values
- Deploy a web application firewall rule that inspects POST requests to /wp-admin/post.php for script payloads inside shortcode parameters
- Review plugin inventory for pdfjs-shortcode version 1.0 or earlier across managed WordPress deployments
Monitoring Recommendations
- Enable WordPress audit logging to track post edits, shortcode modifications, and privilege changes by low-privileged users
- Monitor browser-side Content Security Policy (CSP) violation reports for inline script execution on pages that render PDFs
- Alert on anomalous session activity from administrator accounts shortly after they view contributor-authored posts
How to Mitigate CVE-2025-23943
Immediate Actions Required
- Disable or remove the pdfjs-shortcode plugin until a patched release is confirmed by the vendor
- Audit existing posts and pages for shortcode instances containing script content and remove malicious payloads
- Rotate authentication cookies and credentials for administrator accounts that may have viewed attacker-controlled posts
Patch Information
At the time of publication, no fixed version beyond 1.0 is listed in the advisory. Monitor the Patchstack advisory and the WordPress Plugin Directory for an updated release from the aruvi maintainer. Until a patched version is available, treat the plugin as unmaintained and replace it with a maintained PDF embedding alternative.
Workarounds
- Restrict shortcode-posting capabilities to trusted editor and administrator roles by revoking publish_posts from untrusted accounts
- Enforce a strict Content Security Policy that forbids inline script execution on front-end pages
- Deploy a WAF ruleset that blocks shortcode attribute values containing HTML event handlers or <script> tags
# Configuration example: deactivate the vulnerable plugin via WP-CLI
wp plugin deactivate pdfjs-shortcode
wp plugin delete pdfjs-shortcode
# Audit stored posts for suspicious shortcode payloads
wp db query "SELECT ID, post_title FROM wp_posts WHERE post_content REGEXP 'pdfjs-[a-z]+[^]]*(<script|onerror=|onload=|javascript:)'"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

