CVE-2024-47056

5.1 MEDIUM

📋 TL;DR

This vulnerability allows unauthenticated attackers to directly access Mautic's .env configuration files via web browser, exposing sensitive information like database credentials and API keys. It affects Mautic installations with misconfigured web servers that don't properly restrict access to .env files.

💻 Affected Systems

Products:
  • Mautic
Versions: All versions prior to patched release
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability depends on web server configuration, not Mautic version specifically. Default Apache with .htaccess support may be protected, but Nginx requires manual configuration.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full compromise of the Mautic instance including database access, API key theft, and potential lateral movement to connected systems.

🟠

Likely Case

Sensitive credential disclosure leading to unauthorized database access and potential data exfiltration.

🟢

If Mitigated

No impact if proper web server configurations are in place to block .env file access.

🌐 Internet-Facing: HIGH - Directly accessible via web browser without authentication.
🏢 Internal Only: MEDIUM - Still vulnerable to internal threats but attack surface is reduced.

🎯 Exploit Status

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

Exploitation requires only web browser access to the .env file URL path.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Latest Mautic version

Vendor Advisory: https://github.com/mautic/mautic/security/advisories/GHSA-h2wg-v8wg-jhxh

Restart Required: No

Instructions:

1. Update Mautic to latest version. 2. For Apache: Ensure .htaccess files are respected. 3. For Nginx: Add 'location ~ /\.env { deny all; }' to configuration and reload service.

🔧 Temporary Workarounds

Nginx Configuration Block

linux

Adds explicit denial of access to .env files in Nginx configuration

location ~ /\.env {
    deny all;
}

Apache .htaccess Protection

linux

Ensures Apache respects .htaccess files that should block .env access

Ensure 'AllowOverride All' is set in Apache configuration for Mautic directory

🧯 If You Can't Patch

  • Implement web server configuration to block .env file access
  • Move sensitive credentials out of .env file to secure location

🔍 How to Verify

Check if Vulnerable:

Attempt to access http://your-mautic-url/.env via web browser or curl

Check Version:

Check Mautic version in admin panel or via composer show mautic/core

Verify Fix Applied:

Attempt to access .env file and verify access is denied (403 or 404 response)

📡 Detection & Monitoring

Log Indicators:

  • HTTP 200 responses to .env file requests
  • Unusual database connection attempts from new IPs

Network Indicators:

  • HTTP GET requests to /.env path
  • Sudden outbound database connections

SIEM Query:

web_access_logs | where url contains ".env" and status_code = 200

🔗 References

📤 Share & Export