CVE-2021-27910
📋 TL;DR
CVE-2021-27910 is a stored cross-site scripting (XSS) vulnerability in Mautic's bounce management callback function. Attackers can inject malicious JavaScript via unauthenticated POST requests, which executes when authenticated users view affected lead details. All Mautic instances with bounce management webhooks enabled are vulnerable.
💻 Affected Systems
- Mautic
📦 What is this software?
Mautic by Acquia
Mautic by Acquia
Mautic by Acquia
Mautic by Acquia
⚠️ Risk & Real-World Impact
Worst Case
Attackers steal administrator credentials, compromise the entire Mautic instance, pivot to internal networks, and exfiltrate sensitive customer data.
Likely Case
Session hijacking, credential theft, and unauthorized access to lead/contact data through stored XSS payloads.
If Mitigated
Limited impact with proper input validation and output encoding, potentially only affecting individual user sessions.
🎯 Exploit Status
Exploitation requires sending POST requests to /mailer/*/callback endpoint with malicious JavaScript in error parameters.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.3.4 and later
Vendor Advisory: https://github.com/mautic/mautic/security/advisories/GHSA-86pv-95mj-7w5f
Restart Required: No
Instructions:
1. Backup your Mautic instance. 2. Update to Mautic 3.3.4 or later via composer update or manual upgrade. 3. Clear cache. 4. Verify the fix by checking version.
🔧 Temporary Workarounds
Input Validation Filter
allImplement custom input validation for error and error_related_to parameters in bounce callback handler.
Modify app/bundles/EmailBundle/Controller/PublicController.php to sanitize POST parameters
Webhook Access Restriction
linuxRestrict access to /mailer/*/callback endpoints via firewall rules or web server configuration.
iptables -A INPUT -p tcp --dport 443 -s trusted_ip -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j DROP
🧯 If You Can't Patch
- Disable bounce management webhook functionality entirely
- Implement WAF rules to block JavaScript in error parameters
🔍 How to Verify
Check if Vulnerable:
Check if Mautic version is below 3.3.4 and bounce management is enabled with webhooks.
Check Version:
php bin/console mautic:version
Verify Fix Applied:
Confirm version is 3.3.4+ and test callback endpoint with XSS payloads that should be sanitized.
📡 Detection & Monitoring
Log Indicators:
- POST requests to /mailer/*/callback with JavaScript in parameters
- Unusual error parameter values in webhook logs
Network Indicators:
- External POST requests to bounce callback endpoints
- Outbound connections to suspicious domains after lead view
SIEM Query:
source="mautic.log" AND "POST /mailer/" AND ("error=" OR "error_related_to=") AND ("script" OR "javascript" OR "onerror=")