Security audit · PHP applications
Not just what's wrong. Also how to fix it.
A security audit of your Laravel application. Findings rated by what they can cost you, with a proposed fix for your code. If you want, I'll implement the fixes as pull requests.
- Severity based on your application
- Checks matched to your Laravel version
- One person, not an agency
- Fixes as pull requests, if you want them
01 · What you get
A report you can act on. The fixes, if you want them.
The audit covers your source code and what the application shows to the outside. The report tells you what to fix first and how.
| Severity | Based on what the finding can cost your application, not a generic score |
|---|---|
| Where | The place in your code |
| Fix | A proposed fix for your code. When the fix is short, as a diff |
| Passed | What was checked and found fine |
| Skipped | What doesn't apply to your Laravel version or packages, and why |
Security Assessment ReportConfidential
4.3 Broken access control
Severity: High
Affected: GET /orders/{id}
Description
An authenticated user can retrieve orders belonging to other accounts by modifying the identifier in the request URL.
Recommendation
Implement proper authorization checks on all endpoints that expose user-owned resources.
Page 14 of 37
Customers can open other customers' orders
- Where
app/Http/Controllers/OrderController.php:27- Weakness
- CWE-639
What I found
The show action loads the order by its ID without checking who it belongs to.
Why it matters
Any signed-in customer can read the orders of all other customers by changing the ID in the URL.
Fix
public function show(Request $request, int $id): View { $order = Order::findOrFail($id); $order = $request->user()->orders()->findOrFail($id);
The same finding as it looks in the report: where it is, what it can cost you and how to fix it. Larger fixes I can implement as pull requests, priced after the report.
02 · What's checked
Where the mistakes get made in Laravel applications
The checks are picked by your Laravel and PHP version, the application structure and the installed packages. A few typical examples of what they look for.
From outside
The running application over HTTP, without logging in: security headers, exposed files, CORS, session cookies.
PHP
Code and dependencies: known vulnerabilities in Composer and npm packages, secrets in Git history, the PHP version.
Framework
Laravel: routes and authorization, mass assignment, Livewire, Filament and more.
Laravel Nette planned Symfony later
-
Debug and internals left open
A
.envfile anyone can download, for example because the document root points one level too high. Debug mode on a live server. Telescope, Horizon or Ignition open to anyone./etc/nginx/sites-available/app.conf server_name app.example.com; root /var/www/app; root /var/www/app/public;.env APP_ENV=localAPP_DEBUG=trueAPP_ENV=productionAPP_DEBUG=false -
Mass assignment
Request data written straight into a model. With
$guarded = []on the model, one extra field in the request, sayis_admin=1, is enough.app/Http/Controllers/ProfileController.php public function update(Request $request): RedirectResponse { $request->user()->update($request->all()); $request->user()->update($request->validate([ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'email', 'max:255'], ])); return back(); } -
Missing authorization
Code that checks you are logged in, or checks nothing, but never what you are allowed to do. The audit looks at policies, gates and route middleware. Here, any signed-in customer could open any order by changing the ID in the URL.
app/Http/Controllers/OrderController.php public function show(Request $request, int $id): View { $order = Order::findOrFail($id); $order = $request->user()->orders()->findOrFail($id); -
Raw SQL with user input
whereRawandDB::rawbuilt by gluing request data into a string, where a bound parameter would do.app/Http/Controllers/OrderController.php $orders = Order::query() ->whereRaw("status = '" . $request->input('status') . "'") ->where('status', $request->input('status')) ->latest() ->paginate(); -
Outdated packages
Dependencies with known CVEs. One example: CVE-2021-3129, remote code execution in Ignition when debug mode is on.
Terminal composer audit -
What's visible from outside
What anyone sees without logging in: security headers, the redirect to HTTPS, session cookie flags, CORS and files that should not be public.
/etc/nginx/sites-available/app.conf listen 443 ssl; add_header Strict-Transport-Security "max-age=31536000" always; add_header X-Content-Type-Options "nosniff" always;
03 · The offer
Security audit for your Laravel application
-
1. Audit
€750
- 2 days of work
- Fixed price, confirmed after a scope check, paid upfront
- Findings rated by severity, with proposed fixes
- What passed and what doesn't apply
-
2. Fix the findings
Quoted after the report
- Pull requests with the fixes
- Only the findings you choose
-
3. Retest
Charged separately
- Fixed findings tested again
Not included: compliance certification (SOC 2, ISO 27001), load testing, server configuration audit.
I only test what you assign to me in writing.
Request an audit04 · Process
From the form to the report in six steps
-
01
Form
You tell me which application it is and what it runs on.
-
02
Half-hour call
We talk for 30 minutes about the application and what you want tested.
-
03
NDA and scope check
We sign the NDA and you give me read-only access to the repository. I confirm what the audit covers and the price.
-
04
Contract and invoice
The scope goes into the contract in writing. The audit is paid upfront.
-
05
Audit
Two days of work on your code and on what the application shows to the outside.
-
06
Report
Findings rated by severity, with a proposed fix for your code. If you want the fixes implemented, you ask for a quote.
05 · About me
Vladislav Rajtmajer
I'm one person, not an agency.
- As a teenager
- I was into hacking applications on AmigaOS. I started programming in assembler, on computers with Z80 and MHB 8080A processors.
- Then, for 10 years
- I looked after Debian servers and network infrastructure, including their security.
- The last 13 years
- I've worked on websites and their security. Not only in the PHP application, but also at the level of the operating system and its services: Nginx, Apache, PHP-FPM.
- In recent years
- I focus mainly on Laravel and Nette.
So I know where the mistakes get made in Laravel applications, and what they run on.
06 · FAQ
Common questions
Do you need access to our source code?
Yes. Read-only access to the repository, after we sign the NDA. The audit covers the code, not only what the application shows to the outside.
What happens to our code?
You give me read-only access after we sign the NDA. No production data is needed. How the code is handled is set out in the NDA.
What exactly will you test?
Only what you assign to me in writing. Nothing else.
Will the audit make the application secure?
No audit can promise that. It lowers the risk in the areas it covers. It can't prove that no other problems exist.
What does it cost?
The audit is 2 days of work for €750, a fixed price paid upfront. I confirm it after the scope check, before you pay anything. Fixes are quoted separately after the report. A retest is charged separately.
Can you fix the findings too?
Yes, as pull requests into your repository. It is a separate order: after the report you ask for a quote for the findings you want fixed.
Do we sign an NDA?
Yes, before you give me access to the code.
Which frameworks do you audit?
Laravel. Nette is planned, Symfony later.
07 · Contact
Request an audit
Tell me about the application. I'll get back to you and we'll arrange the half-hour call. After an audit, use the same form to ask for a quote for the fixes.
- After the call: NDA and scope check, then contract and invoice.
- Then two days of audit and the report.
- I only test what you assign to me in writing.
Prefer e-mail? vladislav.rajtmajer1@gmail.com