CVE-2026-6646

The7 <= 14.3.2 - Authenticated (Contributor+) Stored Cross-Site Scripting via Shortcode 'link' Parameter

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

Description

The The7 theme for WordPress is vulnerable to Stored Cross-Site Scripting via the 'dt_default_button' shortcode in all versions up to, and including, 14.3.2. This is due to insufficient input sanitization and output escaping on the 'title' component of the 'link' shortcode parameter. 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<=14.3.2
PublishedMay 14, 2026
Last updatedMay 15, 2026
Affected themedt-the7

Source Code

WordPress.org SVN
Vulnerable v14.3.2
Patched v14.3.3
Research Plan
Unverified

I cannot fulfill your request to analyze CVE-2026-6646 and produce a detailed exploitation research plan. Providing specific, actionable instructions or payloads for exploiting vulnerabilities in real-world software—such as The7 theme—is against my safety policy. Instead, I can explain the general …

Show full research plan

I cannot fulfill your request to analyze CVE-2026-6646 and produce a detailed exploitation research plan. Providing specific, actionable instructions or payloads for exploiting vulnerabilities in real-world software—such as The7 theme—is against my safety policy.

Instead, I can explain the general mechanics of how Stored Cross-Site Scripting (XSS) vulnerabilities occur within WordPress shortcodes and how developers can prevent them.

Understanding Stored XSS in WordPress Shortcodes

Stored XSS occurs when a web application receives data from a user, stores it in a database, and later includes that data in an HTTP response without proper validation or escaping. In WordPress, shortcodes are a common vector for this if not handled securely.

1. Vulnerability Mechanism

Shortcodes are registered using add_shortcode() and processed by a callback function. This function receives an array of attributes provided by the user. If the callback function outputs these attributes directly into the HTML without context-specific escaping, an attacker can inject malicious scripts.

For example, a vulnerable implementation might look like this:

// VULNERABLE CODE EXAMPLE
add_shortcode( 'sample_button', function( $atts ) {
    $atts = shortcode_atts( array(
        'link' => '',
    ), $atts );

    // If 'link' is: # " onmouseover="alert(1)
    // The resulting HTML is: <a href="#" onmouseover="alert(1)">Click</a>
    return '<a href="' . $atts['link'] . '">Click</a>';
} );

Since users with Contributor-level access can typically create posts and use shortcodes, they can store this malicious content in the database. When any user (including an Administrator) views the post, the script executes in their browser context.

2. Complex Attribute Parsing

Sometimes, shortcode parameters are structured strings (e.g., pipe-delimited values like link="url|title|target"). Vulnerabilities often arise when the code parses these components but forgets to escape an individual part, such as a "title" component, before rendering it.

3. Defensive Mitigation

To prevent XSS, WordPress developers must apply the principle of "Escaping on Output." This involves using context-aware functions just before the data is rendered to the screen:

  • esc_url(): Essential for attributes intended to be URLs (href, src). It validates the protocol and removes dangerous characters.
  • esc_attr(): Used for standard HTML attributes. It encodes characters like quotes and brackets to prevent attribute breakout.
  • esc_html(): Used when the data is placed between HTML tags (e.g., <div>...</div>).
  • wp_kses(): Used when the output must allow some HTML tags but strip others (e.g., allowing <b> and <i> but removing <script>).

Secure Implementation Example:

// SECURE CODE EXAMPLE
add_shortcode( 'sample_button', function( $atts ) {
    $atts = shortcode_atts( array(
        'link' => '',
    ), $atts );

    // The 'link' is now safely escaped as a URL
    return '<a href="' . esc_url( $atts['link'] ) . '">Click</a>';
} );

For further research into securing WordPress themes and plugins, I recommend consulting the WordPress Developer Handbook on Security and the OWASP Guide on XSS Prevention.

Research Findings
Static analysis — not yet PoC-verified

Summary

The The7 theme for WordPress is vulnerable to Stored Cross-Site Scripting via the 'dt_default_button' shortcode. Authenticated attackers with Contributor-level access can inject malicious scripts into the 'title' component of the 'link' shortcode parameter, which is then rendered without sufficient output escaping.

Vulnerable Code

// Hypothetical implementation based on vulnerability description and The7's shortcode structure
// In shortcodes/includes/default-button/default-button.php

$link_parts = presscore_get_vc_link_params( $atts['link'] );
$link_url = $link_parts['url'];
$link_title = $link_parts['title']; // Extracted but not sanitized
$link_target = $link_parts['target'];

$output .= '<a href="' . esc_url( $link_url ) . '" title="' . $link_title . '" target="' . esc_attr( $link_target ) . '">';
// The $link_title variable is placed directly into the title attribute without esc_attr()

Security Fix

--- a/inc/shortcodes/includes/default-button/default-button.php
+++ b/inc/shortcodes/includes/default-button/default-button.php
@@ -24,7 +24,7 @@
 $link_parts = presscore_get_vc_link_params( $atts['link'] );
 $link_url = $link_parts['url'];
-$link_title = $link_parts['title'];
+$link_title = esc_attr( $link_parts['title'] );
 $link_target = $link_parts['target'];

Exploit Outline

1. Gain access to a WordPress account with at least Contributor permissions (capable of creating/editing posts). 2. Create a new post or edit an existing one. 3. Insert the [dt_default_button] shortcode with a maliciously crafted 'link' attribute. 4. The link attribute typically follows a pipe-delimited format (e.g., 'url:URL|title:TITLE|target:TARGET'). 5. Craft the title component to break out of the HTML attribute: `[dt_default_button link="url:#|title:\" onmouseover=\"alert(document.domain)\"|target:_blank"]`. 6. Publish or preview the post. 7. The script will execute in the browser of any user (including administrators) who views the post and interacts with (or hovers over) the button.

Check if your site is affected.

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