CVE-2026-8042 Overview
CVE-2026-8042 is a stored Cross-Site Scripting (XSS) vulnerability [CWE-79] in the GitHub Shortcode plugin for WordPress. The flaw affects all versions up to and including 0.1. It originates from insufficient input sanitization and output escaping on the repo attribute of the github shortcode. Authenticated users with Contributor-level access or higher can inject arbitrary JavaScript into posts. The injected script executes in the browser of any visitor who views the affected page.
Critical Impact
Authenticated contributors can persist malicious JavaScript in WordPress pages, enabling session theft, administrative action hijacking, and drive-by attacks against site visitors.
Affected Products
- WordPress GitHub Shortcode plugin versions ≤ 0.1
- WordPress sites permitting Contributor-level account registration or above
- Any WordPress installation rendering content from the vulnerable github shortcode
Discovery Timeline
- 2026-05-27 - CVE-2026-8042 published to the National Vulnerability Database
- 2026-05-27 - Last updated in NVD database
Technical Details for CVE-2026-8042
Vulnerability Analysis
The GitHub Shortcode plugin registers a github shortcode that accepts a repo attribute. The plugin reads this attribute from user-supplied post content and renders it back into the page output without sufficient sanitization or escaping. A contributor can place a crafted github shortcode in a post, embedding HTML or JavaScript via the repo parameter.
When the post is rendered, the unescaped attribute value reaches the DOM and executes in the visitor's browser. Because the script runs under the site's origin, it inherits session cookies and user privileges. If an administrator previews or approves the contributor's submission, the script executes with administrator context. This enables account takeover, plugin installation, or arbitrary content modification.
The attack falls within Scope: Changed, since the contributor's payload executes against higher-privileged users in the same origin. See the Wordfence Vulnerability Report for additional analysis.
Root Cause
The vulnerable shortcode handler concatenates the repo attribute directly into HTML output. The plugin does not apply WordPress escaping functions such as esc_attr() or esc_html() before emitting the value. Review the plugin source code at line 25 for the affected handler.
Attack Vector
An authenticated attacker with at least Contributor privileges crafts a post containing the github shortcode. The repo attribute carries an HTML payload that breaks out of the intended attribute context and injects a <script> tag or event handler. Once the post is rendered, any viewer, including administrators, executes the payload. The vector is network-based and requires no user interaction beyond visiting the page.
The vulnerability is exploited entirely through standard WordPress authoring workflows. No specialized tooling is required to deliver the payload.
Detection Methods for CVE-2026-8042
Indicators of Compromise
- Posts or pages containing [github repo=...] shortcodes with attribute values that include <, >, quote characters, script, onerror, or javascript: substrings
- Unexpected outbound requests from visitor browsers to attacker-controlled domains after viewing posts containing the github shortcode
- New administrator accounts or plugin installations following contributor post activity
Detection Strategies
- Scan the WordPress wp_posts table for shortcode usage matching [github combined with HTML control characters in attributes
- Inspect rendered page DOM for inline scripts originating from shortcode output rather than theme templates
- Correlate Contributor account post submissions with subsequent privileged actions in WordPress audit logs
Monitoring Recommendations
- Enable WordPress activity logging for post creation, edits, and shortcode rendering by non-administrative roles
- Deploy a web application firewall rule that flags shortcode attributes containing HTML tags or JavaScript URI schemes
- Monitor browser Content Security Policy violation reports for inline script execution on pages using the plugin
How to Mitigate CVE-2026-8042
Immediate Actions Required
- Deactivate and remove the GitHub Shortcode plugin until a patched version is released
- Audit existing posts for malicious github shortcode attributes and remove injected payloads
- Restrict Contributor account registration and review pending posts from existing contributors before publication
Patch Information
No fixed version is listed in the NVD entry at publication. All releases through 0.1 remain vulnerable. Site operators should remove the plugin until the maintainer publishes a release that applies esc_attr() or equivalent escaping to the repo attribute. Track updates through the WordPress plugin repository.
Workarounds
- Remove the plugin from the WordPress installation and replace its functionality with a maintained alternative
- Apply a Content Security Policy that disallows inline scripts to limit the impact of injected payloads
- Restrict the unfiltered_html capability and review user role assignments to minimize the contributor population
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

