CVE-2024-5162
📋 TL;DR
The WordPress prettyPhoto plugin up to version 1.2.3 has a stored cross-site scripting vulnerability in the 'url' parameter. Authenticated attackers with Contributor access or higher can inject malicious scripts that execute when users view compromised pages. This affects all WordPress sites using vulnerable versions of the plugin.
💻 Affected Systems
- WordPress prettyPhoto plugin
📦 What is this software?
Prettyphoto by Master Addons
⚠️ Risk & Real-World Impact
Worst Case
Attackers could steal administrator credentials, deface websites, redirect users to malicious sites, or install backdoors for persistent access.
Likely Case
Attackers inject malicious scripts to steal user session cookies, perform phishing attacks, or display unwanted advertisements.
If Mitigated
With proper input validation and output escaping, the vulnerability would be prevented, and only sanitized data would be displayed to users.
🎯 Exploit Status
Exploitation requires authenticated access but is straightforward once credentials are obtained.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.2.4 or later
Vendor Advisory: https://plugins.trac.wordpress.org/browser/prettyphoto/trunk/addon/jltma-wpf-addon.php#L96
Restart Required: No
Instructions:
1. Log into WordPress admin panel. 2. Navigate to Plugins > Installed Plugins. 3. Find 'prettyPhoto' plugin. 4. Click 'Update Now' if update is available. 5. Alternatively, download version 1.2.4+ from WordPress plugin repository and manually update.
🔧 Temporary Workarounds
Disable prettyPhoto plugin
allTemporarily disable the vulnerable plugin until patched
wp plugin deactivate prettyphoto
Restrict user roles
allLimit Contributor and higher role assignments to trusted users only
🧯 If You Can't Patch
- Implement web application firewall (WAF) rules to block XSS payloads in URL parameters
- Regularly audit user accounts and remove unnecessary Contributor+ privileges
🔍 How to Verify
Check if Vulnerable:
Check WordPress admin panel > Plugins > Installed Plugins for prettyPhoto version 1.2.3 or earlier
Check Version:
wp plugin list --name=prettyphoto --field=version
Verify Fix Applied:
Confirm prettyPhoto plugin version is 1.2.4 or later in WordPress admin
📡 Detection & Monitoring
Log Indicators:
- Unusual POST requests to prettyPhoto plugin endpoints with script tags in parameters
- Multiple failed login attempts followed by successful Contributor+ login
Network Indicators:
- HTTP requests containing <script> tags in URL parameters to prettyPhoto endpoints
SIEM Query:
source="wordpress.log" AND ("prettyphoto" AND ("<script>" OR "javascript:"))
🔗 References
- https://plugins.trac.wordpress.org/browser/prettyphoto/trunk/addon/jltma-wpf-addon.php#L96
- https://www.wordfence.com/threat-intel/vulnerabilities/id/c581616d-c9e7-46f2-9c2f-5e082a13fd0b?source=cve
- https://plugins.trac.wordpress.org/browser/prettyphoto/trunk/addon/jltma-wpf-addon.php#L96
- https://www.wordfence.com/threat-intel/vulnerabilities/id/c581616d-c9e7-46f2-9c2f-5e082a13fd0b?source=cve