Your Laravel app has been running for a few years. It works, customers use it, and nobody has looked at its security as a whole since launch. Maybe a customer just sent a security questionnaire, a new investor asked about it, or you read about this month's critical PHP security release and wondered what else you're missing. A Laravel security audit answers one question: where could someone get in, and what would they reach?
This checklist is for owners and CTOs. It covers what a good audit checks, the commands that find the most common problems in minutes, and what you should get at the end. Your developers can work through it themselves, or you can use it to judge an outside audit.
What is a Laravel security audit?
It's a structured review of your application, its dependencies and the servers it runs on, looking for weaknesses before someone else finds them. It is not the same as:
- A dependency scan.
composer auditis one step of an audit, not the audit. - A penetration test. A pen test attacks the running app from outside. An audit also reads the code and configuration, which finds problems a pen test can't see, like a secret in the git history.
- A maintenance plan. Maintenance keeps things patched over time. An audit is a snapshot that tells you where to start. Our Laravel maintenance checklist covers the routine afterwards.
1. Versions: is everything still getting security fixes?
Start here, because an unsupported version makes every other fix temporary.
- PHP: 8.2 loses security support on 31 December 2026, and 8.1 and older already have none (php.net). Check the version that serves web requests, not only the command line.
- Laravel: Laravel 11 and older no longer get security fixes; Laravel 12's end on 24 February 2027 (Laravel support policy).
- Packages and front-end dependencies: known advisories in what you install.
php artisan about
composer audit
composer outdated --direct
npm audit
If the app is behind, our PHP 8.2 end of life guide explains the upgrade order.
2. Configuration: is production set up like production?
The most damaging problems are often one line in .env:
APP_DEBUG=falsein production. With debug on, an error page can show configuration, file paths and sometimes credentials.APP_ENV=production, so packages that behave differently in local mode don't.- A unique, secret
APP_KEY. It encrypts cookies and data. If it was ever shared or committed, rotate it, and plan for the fact that data encrypted with the old key needs re-encrypting. - Secure cookies over HTTPS:
SESSION_SECURE_COOKIE=true, and HTTPS enforced everywhere. - The web server's document root points to
/public, not the project folder, so.env,storageandvendorcan never be downloaded.
A quick outside check: request https://yourdomain.com/.env and https://yourdomain.com/storage/logs/laravel.log. Both must return 404 or 403.
3. Secrets: where are your keys, really?
- Never committed. Check whether
.envor real keys were ever in git, including old commits:
git log --all --oneline -- .env
git log --all -p -S 'sk_live_' | head
- Not in example files.
.env.exampleshould contain placeholders only. A real key in it is a leaked key, even if the repository is private, because it lives in every copy and every backup of the repository. - Rotated when people leave. Payment, mail, cloud storage and API keys that former staff or contractors had access to.
- Not in the front end. Anything in your JavaScript bundle is public. Only publishable keys belong there.
If a secret did leak, removing it from the code is not enough: rotate it at the provider.
4. Access control: can users see what isn't theirs?
This is where the most serious problems in business apps usually are, and automated scanners rarely find them.
- Authorization on every action. Every controller action and Livewire action that reads or changes a record should check a policy or gate. A common bug:
/invoices/1043shows invoice 1043 to any signed-in user who changes the number in the URL. - Tenant isolation. In a multi-tenant app, every query must be scoped to the tenant. See our guide to Laravel multi-tenancy for the patterns.
- Mass assignment. Models with
protected $guarded = [];combined with$request->all()let users set fields they shouldn't, such asis_adminoraccount_id. Use validated data ($request->validated()). - Admin accounts. Two-factor authentication for every admin, and no shared logins.
- Rate limits on login, password reset, and any form that sends email or SMS.
5. Input and output: the classic injection bugs
Laravel protects against most injection by default, so the audit looks for places where the defaults were bypassed:
- Raw SQL with user input:
DB::raw(),whereRaw()ororderByRaw()with values from the request instead of bindings. - Unescaped output:
{!! $value !!}in Blade with anything a user can influence. - File uploads: validated by type and size, stored outside the public folder or with generated names, and never executed.
- Webhooks: signatures verified (Stripe, payment gateways, shipping providers), so nobody can fake a "payment succeeded" call.
- Outgoing requests: features that fetch a URL the user supplies (import from URL, image previews) can be used to reach internal services. Restrict them to allowed hosts.
6. Exposed tools: what's reachable that shouldn't be?
Development tools are useful, and dangerous in public:
- Telescope, Horizon, Pulse, log viewers and admin panels behind authentication and an authorization gate.
- Debug toolbars not installed in production (keep them in
require-dev). - No
phpinfo()pages, old test scripts, database admin tools or backup files in the public folder. - The PHP-FPM status page not reachable from the internet.
- Staging sites protected by a password and marked
noindex, because staging often runs with debug on and copies of real data.
7. Data: what would a breach expose?
- Collect less. Every field you don't store is a field that can't leak.
- Encrypt sensitive fields (Laravel's
encryptedcasts) such as ID numbers or API tokens you store for customers. - Logs shouldn't contain passwords, card data, tokens or full personal records.
- Backups: encrypted, stored off the server, and restored at least once to prove they work.
- Retention: delete old data you no longer need (Laravel's model pruning makes this a scheduled job).
8. Servers and deployment
- PHP, the operating system and the database patched, with someone responsible for watching security releases.
- SSH with keys only, a firewall that only opens the ports you need, and the database not reachable from the internet.
- Deployments from a pipeline, not by editing files on the server.
- Errors and failed jobs monitored, so an attack or a breakage is noticed quickly.
What should you get at the end of an audit?
A useful audit report is short and actionable:
- Findings ranked by risk: what could happen, how likely it is, and what it would expose.
- The evidence: file and line, URL, or command output, so your team can verify each finding.
- A fix for each, with a rough size, so you can plan the work.
- Quick wins first: configuration changes and key rotations that take minutes.
- What wasn't checked, so nobody assumes more coverage than there was.
Then fix the critical findings, re-test them, and put the rest into your normal planning.
How often should you audit?
At minimum once a year, and also when something changes the risk: before a funding round or a large customer contract, after a key developer leaves, before a major upgrade, or after an incident. Between audits, a maintenance plan keeps versions current and catches new advisories.
Get a Laravel security review from CodeBrisk
CodeBrisk was founded in 2014 and has worked with Laravel since 2015, with a 100% Job Success score as a Top Rated agency on Upwork. Through our Laravel maintenance and support service we review apps against this checklist, fix what we find and keep them patched afterwards. If the review shows the app is on unsupported versions, our upgrade and migration service takes it from there.
Contact us and tell us your PHP and Laravel versions to get started.