CVE-2024-58134

8.1 HIGH

📋 TL;DR

This vulnerability allows attackers to forge session cookies in Mojolicious web applications by exploiting predictable default HMAC secrets. Attackers who know or guess the secret can tamper with or hijack user sessions. All Mojolicious applications using default session configuration are affected.

💻 Affected Systems

Products:
  • Mojolicious
Versions: 0.999922 and later versions
Operating Systems: All operating systems running Perl
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications using default session configuration without custom secrets. Applications that explicitly set 'secrets' configuration are not vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete session hijacking allowing attackers to impersonate any user, access sensitive data, and perform unauthorized actions as authenticated users.

🟠

Likely Case

Session tampering and privilege escalation where attackers modify session data to gain unauthorized access or elevate privileges.

🟢

If Mitigated

No impact if proper custom secrets are configured and strong session management controls are implemented.

🌐 Internet-Facing: HIGH - Internet-facing applications are directly exposed to cookie forgery attacks from remote attackers.
🏢 Internal Only: MEDIUM - Internal applications still vulnerable to insider threats or compromised internal systems.

🎯 Exploit Status

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

Exploitation requires knowledge of the default secret or application class name, which can often be guessed or discovered through information disclosure.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Fixed in development versions; ensure you're using latest Mojolicious with proper configuration

Vendor Advisory: https://docs.mojolicious.org/Mojolicious/Guides/FAQ#What-does-Your-secret-passphrase-needs-to-be-changed-mean

Restart Required: Yes

Instructions:

1. Update to latest Mojolicious version. 2. Set a strong custom secret in your application configuration. 3. Restart the application server.

🔧 Temporary Workarounds

Configure Custom Session Secret

all

Set a strong, random secret in your Mojolicious application configuration to replace the default predictable secret.

# In your Mojolicious application configuration:
app->secrets(['your-strong-random-secret-here']);

🧯 If You Can't Patch

  • Implement additional session validation layers and monitor for suspicious session activity
  • Use web application firewall rules to detect and block cookie tampering attempts

🔍 How to Verify

Check if Vulnerable:

Check if your Mojolicious application uses default session configuration without explicitly setting 'secrets' in the configuration.

Check Version:

perl -MMojolicious -e 'print Mojolicious->VERSION'

Verify Fix Applied:

Verify that a strong custom secret is configured and test that session cookies cannot be forged with the old/default secret.

📡 Detection & Monitoring

Log Indicators:

  • Multiple failed session validations from same IP
  • Session ID reuse across different users
  • Unexpected session parameter changes

Network Indicators:

  • Unusual cookie manipulation attempts
  • Requests with forged session cookies

SIEM Query:

source="web_logs" AND (message="session validation failed" OR message="invalid session") AND count > threshold

🔗 References

📤 Share & Export