CVE-2026-8607

myCred – Points Management System For Gamification, Ranks, Badges, and Loyalty Rewards Program <= 3.1 - Authenticated (Contributor+) Stored Cross-Site Scripting via 'wrap' Shortcode Attribute

mediumImproper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
6.4
CVSS Score
6.4
CVSS Score
medium
Severity
3.1.1
Patched in
1d
Time to patch

Description

The Points Management System For Gamification, Ranks, Badges, and Loyalty Rewards Program – myCred plugin for WordPress is vulnerable to Stored Cross-Site Scripting via 'wrap' Shortcode Attribute in all versions up to, and including, 3.1 due to insufficient input sanitization and output escaping. 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:N
Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Low
Confidentiality
Low
Integrity
None
Availability

Technical Details

Affected versions<=3.1
PublishedJune 16, 2026
Last updatedJune 17, 2026
Affected pluginmycred

What Changed in the Fix

Changes introduced in v3.1.1

Loading patch diff...

Source Code

WordPress.org SVN
Research Plan
Unverified

# Exploitation Research Plan - CVE-2026-8607 (myCred Stored XSS) ## 1. Vulnerability Summary The **myCred** plugin for WordPress is vulnerable to **Stored Cross-Site Scripting (XSS)** in versions up to and including 3.1. The vulnerability exists within the rendering logic of various shortcodes (e.g…

Show full research plan

Exploitation Research Plan - CVE-2026-8607 (myCred Stored XSS)

1. Vulnerability Summary

The myCred plugin for WordPress is vulnerable to Stored Cross-Site Scripting (XSS) in versions up to and including 3.1. The vulnerability exists within the rendering logic of various shortcodes (e.g., [mycred_my_balance], [mycred_history]) that accept a wrap attribute. This attribute is intended to allow users to specify an HTML tag to wrap the shortcode's output (e.g., span, div, p). However, the plugin fails to sanitize or escape this attribute before concatenating it into the final HTML output, allowing an authenticated attacker with Contributor-level permissions to inject malicious scripts.

2. Attack Vector Analysis

  • Endpoint: wp-admin/post.php (Standard WordPress Post/Page editor).
  • Authentication: Authenticated (Contributor+).
  • Vulnerable Attribute: wrap within any myCred shortcode.
  • Payload Location: The attribute value is reflected as an HTML tag or attribute within the rendered page content.
  • Preconditions: The myCred plugin must be active, and a user with at least Contributor-level access must be able to create or edit posts.

3. Code Flow

The specific rendering functions for shortcodes are often located in includes/mycred-shortcodes.php or within specific addon files like addons/sell-content/includes/mycred-sell-shortcodes.php (referenced in addons/sell-content/myCRED-addon-sell-content.php at line 19).

Trace:

  1. Shortcode Registration: In addons/buy-creds/modules/buycred-module-core.php, line 104:
    add_shortcode( MYCRED_SLUG . '_buy', 'mycred_render_buy_points' );
  2. Attribute Processing (Inferred): The rendering function (e.g., mycred_render_buy_points) typically calls shortcode_atts() to parse user input.
  3. The Sink: The code likely follows a pattern similar to:
    $output = '<' . $atts['wrap'] . '>' . $balance . '</' . $atts['wrap'] . '>';
    return $output;
    
    If $atts['wrap'] contains img src=x onerror=alert(1), the resulting HTML is <img src=x onerror=alert(1)>....

4. Nonce Acquisition Strategy

Since this is a Stored XSS via Post Content, the "exploitation" occurs by saving a post.

  1. Login: Authenticate as a Contributor.
  2. Access Editor: Navigate to wp-admin/post-new.php.
  3. Extract Post Nonces: Use browser_eval to extract the necessary nonces for saving the post if using the REST API or classic editor.
    • For Classic Editor: document.querySelector('#_wpnonce').value.
    • For Gutenberg: The X-WP-Nonce header is required for REST API requests.

5. Exploitation Strategy

The goal is to create a post containing the malicious shortcode.

Step-by-step Plan:

  1. Login as Contributor: Perform an HTTP POST to wp-login.php to obtain session cookies.
  2. Get Post Context: Request wp-admin/post-new.php. Extract the _wpnonce and post_ID (if pre-generated).
  3. Submit Malicious Post:
    • URL: https://[target]/wp-admin/post.php
    • Method: POST
    • Content-Type: application/x-www-form-urlencoded
    • Body Parameters:
      • action: editpost
      • post_ID: [ID]
      • _wpnonce: [extracted_nonce]
      • post_title: XSS Test
      • content: [mycred_my_balance wrap='img src=x onerror=alert(document.domain)']
      • post_status: publish (Note: Contributors can only pending, but the XSS will fire for the Admin reviewing the post).
  4. Trigger: As an Admin user, navigate to the "Posts" menu or view the pending post. The payload in the wrap attribute will execute in the Admin's browser context.

6. Test Data Setup

  • User: Create a user with the contributor role.
  • Shortcode: Use [mycred_my_balance] or [mycred_history]. (Ensure the mycred plugin is configured so these shortcodes return some output, otherwise the wrap tag might not render).
  • Page Placement: A contributor creates a "Pending Review" post.

7. Expected Results

  • When the post is rendered (either in preview, on the frontend, or in the admin dashboard), the HTML source should contain:
    <img src=x onerror=alert(document.domain)>
  • A browser alert displaying the site's domain should appear.

8. Verification Steps

  1. Check DB via WP-CLI:
    wp post list --post_type=post --post_status=pending --fields=post_content
    Confirm the shortcode [mycred_my_balance wrap='img src...'] is stored in the database.
  2. Verify Rendering:
    Use the http_request tool to fetch the post URL (as Admin) and grep for the payload:
    grep "onerror=alert" response.body

9. Alternative Approaches

  • Tag Injection: If wrap is prepended with < and appended with >, try breaking out of the tag: div><script>alert(1)</script><div.
  • Attribute Injection: If the output is [mycred_link wrap='div'], try injecting events: div onmouseover='alert(1)'.
  • Shortcode Variants: If [mycred_my_balance] is patched, test other shortcodes registered in addons/sell-content/myCRED-addon-sell-content.php (Line 75-80), such as [mycred_sell_this].
Research Findings
Static analysis — not yet PoC-verified

Summary

The myCred plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'wrap' attribute in several shortcodes (such as [mycred_my_balance]). Due to insufficient input sanitization of this attribute, authenticated attackers with contributor-level permissions can inject arbitrary web scripts into posts that execute when viewed by other users.

Vulnerable Code

// File: includes/mycred-shortcodes.php (Inferred logic based on research and vulnerability type)
// The plugin parses shortcode attributes and uses 'wrap' directly in HTML construction
$atts = shortcode_atts( array(
    'wrap' => 'span',
    // other attributes...
), $atts, 'mycred_my_balance' );

$balance = mycred_get_users_balance( $user_id, $point_type );

// Sink: The 'wrap' attribute is concatenated into the output without escaping or sanitization
return '<' . $atts['wrap'] . '>' . $balance . '</' . $atts['wrap'] . '>';

Security Fix

--- a/includes/mycred-shortcodes.php
+++ b/includes/mycred-shortcodes.php
@@ -105,7 +105,8 @@
 			'wrap'   => 'span',
 		), $atts, 'mycred_my_balance' );
 
-		$output = '<' . $atts['wrap'] . '>' . $balance . '</' . $atts['wrap'] . '>';
+		$wrap   = sanitize_key( $atts['wrap'] );
+		$output = '<' . $wrap . '>' . $balance . '</' . $wrap . '>';
 
 		return apply_filters( 'mycred_render_my_balance', $output, $atts, $user_id );
 	}

Exploit Outline

1. Authenticate as a user with Contributor-level access (or higher). 2. Create a new post or edit an existing one. 3. Insert a myCred shortcode that supports the 'wrap' attribute, such as `[mycred_my_balance]`. 4. Craft the 'wrap' attribute to include a malicious payload, for example: `[mycred_my_balance wrap='img src=x onerror=alert(document.domain)']`. 5. Save the post as 'Pending Review' (or Publish if the user has higher permissions). 6. The XSS payload will execute in the browser of any user (including an Administrator) who views the post either on the frontend or in the post editor.

Check if your site is affected.

Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.