CVE-2021-27910

8.2 HIGH

📋 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

Products:
  • Mautic
Versions: Versions prior to 3.3.4
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Affects instances using bounce management with webhook callbacks (Mailjet, SendGrid, etc.). The vulnerability is in the core callback handling.

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: HIGH - The vulnerable endpoint has no authentication and accepts external webhook callbacks.
🏢 Internal Only: MEDIUM - While the vulnerability exists internally, exploitation requires external callback access which may be limited.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

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

all

Implement 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

linux

Restrict 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=")

🔗 References

📤 Share & Export