Laravel Ignition CVE-2021-3129: why debug mode in production is still dangerous
CVE-2021-3129 is a flaw from 2021 in Ignition, the debug error page shipped with Laravel 6 to 8. It lets an attacker run code on the server without logging in when debug mode is on. Ransomware groups use it, and it is still scanned for across the internet every day.
- CVE
CVE-2021-3129 - SeverityCVSS 9.8 Critical
- ProductLaravel Ignition
- ExploitationActively exploited (CISA KEV)
What happened
Ignition shows detailed error pages while you develop a Laravel app. When APP_DEBUG=true, it also exposes routes under /_ignition/. In facade/ignition before 2.5.2, these routes allow unauthenticated code execution. That is CVE-2021-3129.
NVD rates the flaw 9.8 under CVSS 3.1. CISA added it to its Known Exploited Vulnerabilities catalog on 18 September 2023 and lists known use in ransomware campaigns. The fix is years old, but old apps and forgotten staging servers keep it alive.
Debug mode is a risk even without this flaw. Error pages often show .env values: the database password, APP_KEY and API keys.
Who is affected
| Setup | Vulnerable | What to do |
|---|---|---|
| facade/ignition before 2.5.2, debug on | Yes | Upgrade and turn debug off |
| facade/ignition before 2.5.2, debug off | Routes not exposed | Upgrade anyway |
| facade/ignition 2.5.2 or later | Fixed for this CVE | Turn debug off in production |
| spatie/laravel-ignition (newer apps) | Not named in this CVE | Turn debug off in production |
Laravel 6, 7 and 8 are end of life and get no security fixes. Upgrading Ignition closes this flaw, but the app should move to a supported Laravel version.
How to check your app
Run these in the project directory on the server, then test from outside.
composer show facade/ignition
grep -E '^APP_(DEBUG|ENV)=' .env
# From outside: a non-existent URL should return a plain 404
curl -sI https://example.com/this-page-does-not-existOpen the non-existent URL in a browser as well. You should see a short 404 page, not a stack trace, file paths or configuration values. Do this for staging and test servers too.
How to fix it
- Set
APP_DEBUG=falseandAPP_ENV=productionin the production.env. - Run
php artisan config:clear(orconfig:cache) and restart PHP-FPM so the new values load. - Upgrade facade/ignition to 2.5.2 or later, and plan the move off Laravel 6 to 8.
- Confirm from outside that error pages show no stack trace.
- If the site ran with debug on, rotate the database password, API keys and
APP_KEY.
Rotating APP_KEY logs out all users and makes data encrypted with the old key unreadable. Plan it: find out which data is encrypted with the key before you change it.
What to look for
If the app had debug mode on in production, assume the secrets in .env were seen. Check for signs of compromise: new or changed PHP files in public and storage, unknown admin users, unexpected cron jobs, and logins to your database or cloud accounts from unknown places. A web application penetration test checks for exposed debug pages and leaked configuration.
Questions
My app uses a newer Laravel version. Am I affected?
Newer apps use spatie/laravel-ignition, which this CVE does not name. Debug mode in production still leaks secrets, so keep APP_DEBUG=false.
Is turning off debug mode enough?
It closes the exposed routes. Still upgrade Ignition, and rotate secrets if the site was exposed with debug on.
Why is a 2021 flaw still a problem?
Old Laravel apps and staging servers keep running with debug on. Attackers scan for them every day because they are easy to find.
This article is written for defenders and contains no exploit code. It reflects the vendor advisories on the date above; always check the vendor advisory for the latest fixed versions.
Not sure whether you are affected?
We check your servers and applications for this vulnerability and others like it, and give you a clear report with fixes.