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-58653 Overview
CVE-2025-58653 is a stored Cross-Site Scripting (XSS) vulnerability [CWE-79] in the JSM file_get_contents() Shortcode WordPress plugin by JS Morisset. The flaw affects all versions of the wp-file-get-contents plugin up to and including 2.7.1. The vulnerability stems from improper neutralization of user-supplied input during web page generation. Authenticated attackers with low-level privileges can inject persistent JavaScript payloads that execute in the browsers of site visitors and administrators. Successful exploitation requires user interaction, and the impact crosses security scopes because scripts execute in the context of the affected WordPress site.
Critical Impact
Attackers with contributor-level access can store malicious JavaScript that executes in visitor and administrator browsers, enabling session hijacking, credential theft, and administrative account takeover.
Affected Products
- JSM file_get_contents() Shortcode plugin (wp-file-get-contents) versions up to and including 2.7.1
- WordPress installations with the vulnerable plugin activated
- Any WordPress site permitting low-privilege authenticated users (e.g., contributors) to author content
Discovery Timeline
- 2025-09-22 - CVE-2025-58653 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-58653
Vulnerability Analysis
The vulnerability resides in how the JSM file_get_contents() Shortcode plugin processes shortcode attributes and output before rendering them into WordPress pages. The plugin fails to properly sanitize or escape user-supplied input, allowing attackers to embed HTML and JavaScript that persists in the database. When a visitor or administrator loads a page containing the malicious shortcode, the injected script executes in their browser under the site's origin.
Because the scope is changed (S:C in the CVSS vector), the injected code can affect resources beyond the vulnerable component, including the WordPress admin session. Exploitation requires an authenticated user account with content-authoring privileges and a victim to view the affected page.
Root Cause
The root cause is missing output encoding and input sanitization on shortcode attributes handled by the plugin. WordPress provides functions such as esc_html(), esc_attr(), and wp_kses() for context-aware escaping, but the vulnerable plugin does not consistently apply them to attacker-controllable values before echoing them into the DOM.
Attack Vector
An attacker with at least contributor-level access on the target WordPress site crafts a post or page containing the vulnerable shortcode with malicious payload data. The payload is stored in the WordPress database. When any authenticated or unauthenticated user renders the page, the browser executes the injected JavaScript. Attack scenarios include stealing administrator cookies, performing actions on behalf of the admin, injecting cryptominers, or redirecting visitors to phishing infrastructure. Refer to the Patchstack XSS Vulnerability Report for additional technical detail.
Detection Methods for CVE-2025-58653
Indicators of Compromise
- Unexpected <script> tags, event handlers (e.g., onerror, onload), or javascript: URIs within wp_posts content stored via JSM shortcodes
- Outbound HTTP requests from user browsers to unknown domains after loading pages containing the shortcode
- New or modified WordPress administrator accounts created shortly after suspicious page views
Detection Strategies
- Audit the wp_posts table for entries containing the [file_get_contents] shortcode with suspicious attribute values or embedded HTML
- Deploy a Web Application Firewall (WAF) with rules that flag XSS payload patterns in POST requests to wp-admin/post.php
- Monitor plugin file integrity for versions of wp-file-get-contents at or below 2.7.1
Monitoring Recommendations
- Enable WordPress audit logging to record post creation and edits by contributor-level accounts
- Alert on Content Security Policy (CSP) violation reports indicating inline script execution on pages using the plugin
- Track anomalous session activity for administrator accounts, particularly cookie reuse from unfamiliar IP addresses
How to Mitigate CVE-2025-58653
Immediate Actions Required
- Deactivate the JSM file_get_contents() Shortcode plugin until a patched version is confirmed installed
- Review all posts and pages containing the [file_get_contents] shortcode and remove attacker-controlled content
- Rotate WordPress administrator credentials and invalidate active sessions if compromise is suspected
Patch Information
At the time of publication, versions up to and including 2.7.1 are affected. Site administrators should consult the Patchstack advisory and the WordPress plugin repository for the latest fixed release, then update the plugin through the WordPress admin dashboard.
Workarounds
- Restrict contributor and author account creation, and audit existing low-privilege accounts for legitimacy
- Deploy a Content Security Policy (CSP) that disallows inline scripts to reduce XSS impact
- Use a WAF rule set to block common XSS payload patterns targeting WordPress shortcode parameters
# Example WP-CLI command to deactivate the vulnerable plugin
wp plugin deactivate wp-file-get-contents
# Verify installed version
wp plugin get wp-file-get-contents --field=version
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

