CVE-2024-13919

8.0 HIGH

📋 TL;DR

Laravel applications running vulnerable versions are susceptible to reflected cross-site scripting (XSS) attacks when debug mode is enabled. Attackers can inject malicious scripts via route parameters that get improperly encoded on debug error pages. This affects any Laravel application with debug mode enabled running versions 11.9.0 through 11.35.1.

💻 Affected Systems

Products:
  • Laravel Framework
Versions: 11.9.0 through 11.35.1
Operating Systems: All
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when debug mode is enabled (APP_DEBUG=true). Production environments typically have debug disabled.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers can execute arbitrary JavaScript in victims' browsers, potentially stealing session cookies, performing actions as the user, or redirecting to malicious sites.

🟠

Likely Case

Session hijacking, credential theft, or defacement of error pages through injected content.

🟢

If Mitigated

Limited impact if debug mode is disabled in production, as the vulnerability only affects debug error pages.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires debug mode enabled and attacker to craft malicious URLs with XSS payloads in route parameters.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v11.36.0

Vendor Advisory: https://github.com/laravel/framework/releases/tag/v11.36.0

Restart Required: No

Instructions:

1. Update Laravel framework to version 11.36.0 or later using composer: composer require laravel/framework:^11.36.0
2. Run composer update
3. Clear application cache: php artisan optimize:clear

🔧 Temporary Workarounds

Disable Debug Mode

all

Set APP_DEBUG=false in .env file to prevent debug error pages from being displayed.

echo 'APP_DEBUG=false' >> .env
php artisan config:clear

🧯 If You Can't Patch

  • Disable debug mode in production environments immediately.
  • Implement web application firewall (WAF) rules to block XSS payloads in URLs.

🔍 How to Verify

Check if Vulnerable:

Check Laravel version and debug mode status: php artisan --version && grep APP_DEBUG .env

Check Version:

php artisan --version

Verify Fix Applied:

Confirm Laravel version is 11.36.0 or higher: php artisan --version

📡 Detection & Monitoring

Log Indicators:

  • Unusual error page requests with JavaScript in URL parameters
  • Multiple 500 error responses with suspicious parameter values

Network Indicators:

  • HTTP requests containing script tags or JavaScript in route parameters
  • Requests to error pages with encoded payloads

SIEM Query:

source="laravel.log" AND ("APP_DEBUG" OR "error") AND ("script" OR "javascript:" OR "onerror=" OR "<script")

🔗 References

📤 Share & Export