myCred – Points Management System For Gamification, Ranks, Badges, and Loyalty Rewards Program <= 3.1 - Authenticated (Contributor+) Stored Cross-Site Scripting via 'wrap' Shortcode Attribute
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
1Patches
Vulnerability mechanics
Root cause
"Insufficient input sanitization and output escaping on the 'wrap' shortcode attribute allows stored cross-site scripting."
Attack vector
An attacker with contributor-level WordPress access or higher inserts a myCred shortcode and sets its `wrap` attribute to a malicious payload containing JavaScript. When any user (including administrators) views the page containing that shortcode, the injected script executes in their browser. This is a stored cross-site scripting (XSS) attack because the payload is persisted in the page content and triggers on every visit. The vulnerability is caused by insufficient input sanitization and output escaping on the `wrap` shortcode attribute [CWE-79].
Affected code
The vulnerability resides in the myCred plugin's shortcode attribute handling. The `wrap` attribute of a shortcode is not properly sanitized or escaped before being output, allowing authenticated users with contributor-level access or above to inject arbitrary HTML and JavaScript. The patch file `mycred-functions.php` (around line 4399) shows the `allowed_html_tags()` method which defines permitted tags but does not cover the `wrap` attribute context.
What the fix does
The patch adds proper output escaping (likely using `esc_attr()` or `wp_kses()`) to the `wrap` shortcode attribute before it is rendered in the HTML. Previously the attribute value was output raw, allowing arbitrary HTML and JavaScript. By escaping the attribute value, the plugin ensures that any HTML entities or script tags are neutralized and displayed as literal text rather than executed. The `allowed_html_tags()` method already existed but was not applied to this specific attribute context.
Preconditions
- authThe attacker must have at least Contributor-level access to the WordPress site
- configThe site must have the myCred plugin installed and active with version up to 3.1
- inputThe attacker must be able to insert a myCred shortcode with a 'wrap' attribute into a post or page
Generated on Jun 17, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- plugins.trac.wordpress.org/browser/mycred/tags/3.0.2/includes/classes/class.query-leaderboard.phpmitre
- plugins.trac.wordpress.org/browser/mycred/tags/3.0.2/includes/shortcodes/mycred_leaderboard.phpmitre
- plugins.trac.wordpress.org/browser/mycred/tags/3.0.6/includes/classes/class.query-leaderboard.phpmitre
- plugins.trac.wordpress.org/browser/mycred/tags/3.0.6/includes/shortcodes/mycred_leaderboard.phpmitre
- plugins.trac.wordpress.org/browser/mycred/tags/3.1.1/includes/classes/class.query-leaderboard.phpmitre
- plugins.trac.wordpress.org/browser/mycred/tags/3.1.1/includes/mycred-functions.phpmitre
- plugins.trac.wordpress.org/changeset/3572451mitre
- www.wordfence.com/threat-intel/vulnerabilities/id/041a7c9a-d7dc-4742-b879-f1836f324a46mitre
News mentions
0No linked articles in our index yet.