Findings
HIGH1. Debug mode is enabled in a production environment
.env · Confirmed · security · sec.debug-in-production
With APP_DEBUG=true, error pages show stack traces, configuration values and environment variables, including credentials, to anyone who triggers an error. Older debug page versions have also had remote code execution vulnerabilities.
Evidence
APP_ENV=production (.env: APP_ENV); APP_DEBUG=true (.env: APP_DEBUG).
Remediation
Set APP_DEBUG=false in the production environment and run "php artisan config:cache" after deploying.
HIGH2. APP_KEY is not set
.env · Confirmed · security · sec.app-key-missing
Laravel uses APP_KEY to encrypt cookies, sessions and encrypted model attributes. Without it, encryption fails. A key added later invalidates existing encrypted data.
Evidence
APP_KEY is defined in .env but empty.
Remediation
Generate a key with "php artisan key:generate" in each environment, and store it in the environment rather than in code.
HIGH3. The application key is hardcoded in config/app.php
config/app.php · Confirmed · security · sec.app-key-hardcoded
A key written into a committed config file is shared by every environment and everyone with access to the repository.
Evidence
'key' => base**** (51 characters)
Remediation
Use 'key' => env('APP_KEY'), rotate the exposed key, and set APP_KEY per environment.
HIGH4. CORS allows any origin together with credentials
config/cors.php · Confirmed · security · sec.cors-wildcard-credentials
With supports_credentials enabled, Laravel reflects the requesting origin when allowed_origins is "*". Any website could then make authenticated requests with the user's cookies and read the responses.
Evidence
'allowed_origins' => ['*'], 'supports_credentials' => true (config/cors.php:supports_credentials)
Remediation
List the exact front-end origins in allowed_origins (or allowed_origins_patterns) when credentials are required.
HIGH5. Laravel Debugbar is enabled in production
.env · Confirmed · security · sec.debug-tool-enabled-in-production
Debugbar renders queries, session data and request details into every page.
Evidence
APP_ENV=production (.env: APP_ENV); DEBUGBAR_ENABLED=true
Remediation
Set DEBUGBAR_ENABLED=false in production.
HIGH6. Public directory contains 1 database file or dump
public/ · Potential risk, needs review · security · sec.public-sensitive-file
Everything under public/ can be downloaded by visitors unless the web server blocks it. A database file or dump there may expose source code, data or credentials.
Evidence
- public/backup.sql
Remediation
Remove these files from public/ (and from the server), and keep backups and dumps outside the web root.
HIGH7. Public directory contains 1 debug or admin script
public/ · Potential risk, needs review · security · sec.public-sensitive-file
Everything under public/ can be downloaded by visitors unless the web server blocks it. A debug or admin script there may expose source code, data or credentials.
Evidence
- public/phpinfo.php
Remediation
Remove these files from public/ (and from the server), and keep backups and dumps outside the web root.
HIGH8. A public route calls phpinfo()
routes/ · Confirmed · security · sec.route-phpinfo
phpinfo() prints the PHP configuration, server paths and all environment variables, which in Laravel include database passwords and APP_KEY.
Evidence
- GET phpinfo calls phpinfo() (exposes PHP configuration and environment variables), routes/web.php:8
Remediation
Remove the route. If PHP configuration must be inspected, do it from the command line.
HIGH9. 1 route closure runs dangerous operations without authentication
routes/ · Potential risk, needs review · security · sec.route-dangerous-closure
These closures run commands, raw SQL, file writes or debug dumps, and no authentication middleware was found on the route. Anyone who can reach the URL can trigger them.
Evidence
- GET debug/run calls Artisan::call() (runs Artisan commands), routes/web.php:11
Remediation
Remove debug and maintenance routes, or move the logic to Artisan commands. If they must stay, protect them with authentication and authorization middleware.
HIGH10. CSRF protection is disabled for all routes
app/Http/Middleware/VerifyCsrfToken.php · Confirmed · security · sec.csrf-disabled
The CSRF exclusion list contains a wildcard that matches every route. Any website a logged-in user visits can submit forms to the application on their behalf.
Evidence
Excluded URIs: *
Remediation
Remove the wildcard and exclude only specific endpoints that verify requests another way (e.g. signed webhooks).
HIGH11. 1 value matches a known credential format
source code · Confirmed · security · sec.secret-token
These values match the format of real API keys, tokens or private keys. Anyone with access to the code can use them, and once committed they stay in the git history.
Evidence
- config/services.php:12: NoTokenLimit API key ntl_**** (29 characters)
Remediation
Revoke and rotate each credential, move it to the environment (.env / secret manager), and read it through config().
HIGH12. Shell command built with request input (1 occurrence)
source code · Potential risk, needs review · security · sec.command-injection
A shell command contains request input. If the input is not strictly validated, attackers can run arbitrary commands on the server.
Evidence
- app/Http/Controllers/ReportController.php:17: exec('convert ' . $request->input('file') . ' out.pdf');Remediation
Avoid shell commands for user-facing features. Otherwise pass arguments with Symfony Process arrays or escapeshellarg(), and validate input against an allow-list.
HIGH13. Raw SQL built with request input (1 occurrence)
source code · Potential risk, needs review · security · sec.sql-injection
Request input is concatenated or passed directly into a raw SQL expression, which allows SQL injection.
Evidence
- app/Http/Controllers/ReportController.php:14: $rows = DB::select("SELECT * FROM orders WHERE status = '" . $request->input('status') . "'");Remediation
Use query builder methods or bindings: whereRaw("email = ?", [$email]); never concatenate input into SQL.
HIGH14. Request input is echoed without escaping
resources/views · Potential risk, needs review · security · sec.blade-unescaped-input
{!! !!} prints raw HTML. Echoing request input this way allows reflected cross-site scripting.
Evidence
- resources/views/comments.blade.php:4: {!! request('q') !!}Remediation
Use {{ }} (escaped output) for anything derived from input.
MEDIUM15. Laravel 10 no longer receives security fixes
composer.lock · Confirmed · environment · env.laravel-end-of-life
Vulnerabilities discovered in this Laravel version will not be patched upstream. This is a maintenance risk, not proof of a current vulnerability.
Evidence
Laravel 10 security support ended on 2025-02-04 (https://laravel.com/docs/releases#support-policy).
Remediation
Plan an upgrade to a supported Laravel release. Upgrade one major version at a time, following the official upgrade guides.
MEDIUM16. Session driver is "array" in production
.env · Confirmed · configuration · config.production-array-session
The array driver keeps data only for the current request. Cached values are lost immediately, and with sessions users cannot stay logged in.
Evidence
APP_ENV=production (.env: APP_ENV); session driver "array" (.env: SESSION_DRIVER).
Remediation
Use a persistent driver (redis, database, file, memcached) in production.
MEDIUM17. .env.example contains an application key
.env.example · Confirmed · security · sec.app-key-in-example
Example env files are normally committed. A real key there may be copied into environments, and anyone with the repository could decrypt their data.
Evidence
APP_KEY in .env.example is not empty.
Remediation
Leave APP_KEY empty in .env.example and generate a unique key per environment with "php artisan key:generate". Rotate any key that has been shared.
MEDIUM18. Session cookie is readable by JavaScript
config/session.php · Confirmed · security · sec.session-not-http-only
With http_only disabled, any cross-site scripting flaw can steal session cookies and take over accounts.
Evidence
session.http_only = false (config/session.php:http_only)
Remediation
Set 'http_only' => true in config/session.php (the Laravel default).
MEDIUM19. SameSite=None session cookie without the Secure flag
config/session.php · Potential risk, needs review · security · sec.session-same-site-none
SameSite=None sends the session cookie on cross-site requests, which weakens CSRF protection. Browsers reject SameSite=None cookies that are not also Secure.
Evidence
same_site = none (config/session.php:same_site); secure = null (config/session.php:secure (env('SESSION_SECURE_COOKIE') unset, no default))Remediation
Use SameSite "lax" (the default) unless cross-site embedding is required; if it is, set SESSION_SECURE_COOKIE=true.
MEDIUM20. Bcrypt work factor is 4 in production
.env · Confirmed · security · sec.weak-bcrypt-rounds
A low bcrypt cost makes stolen password hashes much faster to crack. Low values are normal in tests, not in production.
Evidence
APP_ENV=production (.env: APP_ENV); bcrypt rounds = 4 (.env: BCRYPT_ROUNDS)
Remediation
Use at least 12 rounds (the Laravel default) in production; keep low values only in phpunit.xml / .env.testing.
MEDIUM21. Laravel Debugbar is a production dependency
composer.json · Confirmed · security · sec.debug-package-in-production
Laravel Debugbar is listed under "require", so it is installed in production. Debugging tools expose queries, request data and configuration when enabled by mistake.
Evidence
"require": {"barryvdh/laravel-debugbar": "^3.9"}Remediation
Move barryvdh/laravel-debugbar to "require-dev" (composer require --dev barryvdh/laravel-debugbar) so production installs with --no-dev exclude it.
MEDIUM22. .env is world-readable
.env · Confirmed · security · sec.env-permissions
Any local user or process on the server can read the application's credentials.
Evidence
Mode 0644
Remediation
Restrict it to the owner and the web server group, e.g. chmod 640 .env.
MEDIUM23. 4 routes with sensitive-looking paths have no authentication middleware
routes/ · Potential risk, needs review · security · sec.route-sensitive-public
The path suggests privileged functionality (admin, settings, export, ...) and no authentication middleware was found at the route, group or controller level. The controller may still check access itself; verify each one.
Evidence
- DELETE api/users/{id} ("users"; middleware: api), routes/api.php:7
- GET admin/users ("admin"; middleware: web), routes/web.php:9
- GET admin/users ("admin"; middleware: web), routes/web.php:10
- GET settings ("settings"; middleware: web), routes/web.php:15Remediation
Add auth middleware (and authorization such as can: or policies) to the route group, or confirm the endpoint is intentionally public.
MEDIUM24. 3 secrets are hardcoded
source code · Confirmed · security · sec.secret-literal
Passwords, secrets or API keys are written as string literals. Even when the value is only used locally, committed credentials tend to be reused in other environments.
Evidence
- app/Services/PaymentService.php:7: 'apiToken' => tok_**** (21 characters)
- config/services.php:6: 'secret' => Live**** (24 characters)
- resources/js/app.js:1: stripeSecret = Fron**** (22 characters)
Remediation
Replace the literal with env('NAME') in a config file, set the value in each environment, and rotate it if it was ever real.
MEDIUM25. 1 env() default contains a secret
source code · Potential risk, needs review · security · sec.secret-env-default
env('X', 'value') falls back to the literal when the variable is missing, so the 'default' quietly becomes the production credential if an environment is misconfigured.
Evidence
- config/services.php:9: env('MAILGUN_SECRET', mg-D**** (21 characters))Remediation
Remove the default (env('DB_PASSWORD')) so a missing variable fails loudly, and rotate the value if it is real.
MEDIUM26. 1 URL embeds a password
source code · Confirmed · security · sec.secret-url-credentials
Connection strings such as redis://user:[REDACTED]@host include the password in source code and in logs that print the URL.
Evidence
- config/services.php:14: redis://default:Redi**** (13 characters)@...
Remediation
Build the URL from environment variables or pass the password separately.
MEDIUM27. 1 secret-looking value in an env file other than .env
source code · Potential risk, needs review · security · sec.secret-in-env-variant
Env files other than .env (.env.example, .env.testing, backups) are often committed, copied or deployed. Real-looking values for sensitive keys there are likely live credentials.
Evidence
- .env.backup:2: Old-**** (19 characters) (DB_PASSWORD)
Remediation
Replace the values with placeholders (or delete backup copies) and rotate any real credentials.
MEDIUM28. Unsafe unserialize() of non-literal data (1 occurrence)
source code · Potential risk, needs review · security · sec.unsafe-unserialize
unserialize() on attacker-controlled data can instantiate arbitrary classes and trigger gadget chains, leading to remote code execution.
Evidence
- app/Http/Controllers/ReportController.php:18: $cart = unserialize($request->cookie('cart'));Remediation
Use json_decode() for data from outside, or pass ['allowed_classes' => false] (or a list of safe classes).
MEDIUM29. Raw SQL assembled by concatenation (1 occurrence)
source code · Potential risk, needs review · security · sec.raw-sql-concatenation
Raw SQL strings are built by concatenating or interpolating variables. If any of them can come from a user, this is SQL injection.
Evidence
- app/Http/Controllers/ReportController.php:16: $users = User::query()->whereRaw("email = '$email'")->get();Remediation
Use ? placeholders with bindings, or query builder methods, instead of string building.
MEDIUM30. File or URL access using request input (1 occurrence)
source code · Potential risk, needs review · security · sec.path-or-url-from-input
A file path or URL comes directly from the request. This can allow path traversal (reading or deleting arbitrary files) or server-side request forgery.
Evidence
- app/Http/Controllers/ReportController.php:19: $remote = file_get_contents($request->input('url'));Remediation
Validate input against an allow-list, use basename() / Storage paths you construct yourself, and restrict outbound hosts.
MEDIUM31. Fast hash (md5/sha1) applied to a password (1 occurrence)
source code · Potential risk, needs review · security · sec.weak-password-hash
MD5 and SHA-1 are fast hashes and are unsuitable for passwords; hashes can be cracked quickly after a breach.
Evidence
- app/Http/Controllers/ReportController.php:21: $hash = md5($request->password);
Remediation
Use Hash::make() / bcrypt() / Argon2id via Laravel's Hash facade, and rehash on login.
MEDIUM32. Mass-assignment protection is disabled globally
source code · Potential risk, needs review · security · sec.model-unguard
Model::unguard() turns off $fillable/$guarded for every model. Any code that passes request input to create() or update() can then set any column. It is safe only inside seeders or tests.
Evidence
- app/Providers/AppServiceProvider.php:12: Model::unguard()
Remediation
Remove Model::unguard() from application code (keep it in seeders), and use $fillable on models.
LOW33. 1 route is registered more than once
routes/ · Confirmed · routes · routes.duplicate
When two routes share a method and URI, the later definition silently replaces the earlier one, so one of them is unreachable.
Evidence
- GET admin/users: routes/web.php:10 overrides routes/web.php:9
Remediation
Remove or rename one of each pair of duplicate routes.
LOW34. 1 controller referenced by routes could not be found
routes/ · Potential risk, needs review · routes · routes.missing-controller
The controller class does not exist at the path its namespace maps to under composer.json PSR-4 rules. Requests to these routes would fail, unless the class is loaded some other way (classmap, custom autoloader).
Evidence
- App\Http\Controllers\SettingsController (used by GET settings, routes/web.php:15)
Remediation
Create the controller, fix the namespace in the route definition, or remove the route.
LOW35. Queued jobs run synchronously in production
.env · Confirmed · configuration · config.production-sync-queue
With the "sync" queue connection, queued jobs, mail and notifications run inside the web request. This slows responses, and a failing job fails the request.
Evidence
APP_ENV=production (.env: APP_ENV); queue connection "sync" (.env: QUEUE_CONNECTION).
Remediation
Use a real queue backend (database, redis, sqs) in production and run a queue worker.
LOW36. Log level is "debug" in production
.env · Confirmed · configuration · config.production-debug-logging
Debug-level logging in production produces large logs and is more likely to record request data, queries or tokens.
Evidence
APP_ENV=production (.env: APP_ENV); log level "debug" (.env: LOG_LEVEL).
Remediation
Set LOG_LEVEL to "info", "warning" or "error" in the production environment.
LOW37. 2 key columns may be missing an index
database/migrations · Potential risk, needs review · database · db.missing-index
Columns named *_id are usually used in joins and WHERE clauses. These have no index or foreign key constraint in any migration, so lookups on them scan the whole table as it grows. Indexes added outside migrations are not visible.
Evidence
- orders.user_id (unsignedbiginteger) database/migrations/2024_01_01_000000_create_orders_table.php:14
- orders.coupon_id (foreignid) database/migrations/2024_01_01_000000_create_orders_table.php:15
Remediation
Add ->index() (or use foreignId()->constrained()) for columns used in queries, in a new migration.
LOW38. Session cookie is not marked Secure in production
config/session.php · Potential risk, needs review · security · sec.session-cookie-not-secure
The application is served over HTTPS but the session cookie may also be sent over plain HTTP, where it can be intercepted (e.g. on a downgraded or mixed-content request).
Evidence
APP_ENV=production (.env: APP_ENV); APP_URL=https://shop.example.test; session.secure = null (config/session.php:secure (env('SESSION_SECURE_COOKIE') unset, no default))Remediation
Set SESSION_SECURE_COOKIE=true in the production environment.
LOW39. 1 environment file variant present in the project root
project root · Potential risk, needs review · security · sec.env-variant-present
Copies of .env (production settings, backups) often contain real credentials and are easy to deploy or commit by accident. Whether they are tracked by git could not be determined.
Evidence
- .env.backup
Remediation
Make sure these files are git-ignored and excluded from deployments, or delete them.
LOW40. 1 API endpoint changes data without authentication middleware
routes/api.php · Potential risk, needs review · security · sec.route-api-write-public
POST/PUT/PATCH/DELETE API routes without authentication middleware can be called by anyone. This is sometimes intended (sign-up, contact forms, webhooks with signature checks), so review each route.
Evidence
- POST api/orders/{order}/refund -> OrderController@refund, routes/api.php:6Remediation
Protect the routes with auth:sanctum (or another guard), or document why they are public and how they are protected (signatures, rate limiting).
LOW41. All proxies are trusted
app/Http/Middleware/TrustProxies.php · Potential risk, needs review · security · sec.trust-all-proxies
Trusting every proxy makes Laravel believe the X-Forwarded-For/-Proto/-Host headers of any request. That is correct only behind a load balancer that strips client-supplied headers. Otherwise clients can spoof their IP address (bypassing IP-based rate limits and logs) or the scheme and host.
Evidence
proxies = *
Remediation
List the load balancer's addresses explicitly, or confirm that the application is reachable only through a proxy that overwrites these headers.
LOW42. Redirect to a URL from request input (1 occurrence)
source code · Potential risk, needs review · security · sec.open-redirect
Redirecting to a user-supplied URL lets attackers craft links on your domain that forward victims to phishing sites.
Evidence
- app/Http/Controllers/ReportController.php:25: return redirect($request->input('next'));Remediation
Redirect only to relative paths or an allow-list of hosts (e.g. url()->previous() or named routes).
LOW43. Model writes with all request input (1 occurrence)
source code · Potential risk, needs review · security · sec.mass-assignment-request-all
Passing $request->all() to create/update/fill relies entirely on the model's $fillable/$guarded configuration to block privileged columns.
Evidence
- app/Http/Controllers/ReportController.php:20: User::create($request->all());
Remediation
Use $request->validated() from a Form Request, or $request->only([...]) with the expected fields.
LOW44. 1 model disables mass-assignment protection
app/Models · Potential risk, needs review · security · sec.model-guarded-empty
With $guarded = [] every attribute can be mass-assigned. This is safe only if the model never receives unfiltered input (e.g. $request->all()).
Evidence
- app/Models/User.php:9: User: protected $guarded = [];
Remediation
Declare $fillable with the attributes users may set, or make sure only validated data reaches these models.
LOW45. 1 Blade expression prints unescaped HTML
resources/views · Potential risk, needs review · security · sec.blade-unescaped-output
{!! !!} bypasses escaping. That is fine for HTML the application generates itself, but stored user content (comments, profile fields, rich text) printed this way allows stored XSS.
Evidence
- resources/views/comments.blade.php:3: {!! $comment->body !!}Remediation
Use {{ }} unless the value is trusted HTML. For user-supplied rich text, sanitise it on save (e.g. with an HTML purifier) before printing it raw.
LOW46. No automated tests found
tests/ · Confirmed · quality · quality.no-tests
Without tests, upgrades (including security updates of Laravel and dependencies) cannot be verified quickly, so they tend to be postponed.
Evidence
No *Test.php files under tests/ (PHPUnit is installed).
Remediation
Start with feature tests for the most important routes (php artisan make:test), and run them in CI.
INFO47. 6 variables in .env are missing from .env.example
.env.example · Confirmed · configuration · config.env-keys-not-in-example
Variables used locally but absent from .env.example are easy to forget when deploying or onboarding. Only variable names are compared; values are never read.
Evidence
- APP_URL
- SESSION_DRIVER
- QUEUE_CONNECTION
- LOG_LEVEL
- BCRYPT_ROUNDS
- DEBUGBAR_ENABLED
Remediation
Add the missing variable names to .env.example with placeholder values.
INFO48. 1 column is declared with foreignId() but no constraint
database/migrations · Potential risk, needs review · database · db.unconstrained-foreign-id
foreignId() alone only creates an unsigned big integer column. Without ->constrained() the database does not enforce that the referenced row exists. This may be intentional, e.g. for polymorphic or cross-database references.
Evidence
- orders.coupon_id database/migrations/2024_01_01_000000_create_orders_table.php:15
Remediation
Add ->constrained() (with ->cascadeOnDelete() or ->nullOnDelete() as appropriate) where referential integrity is wanted.
INFO49. 1 migration statement runs raw SQL
database/migrations · Confirmed · database · db.raw-sql-migrations
Raw SQL in migrations is often database-specific and is invisible to this analysis. Review it when changing database engines.
Evidence
- database/migrations/2024_01_01_000000_create_orders_table.php:23
Remediation
Prefer schema builder methods where possible, and document engine-specific statements.
INFO50. Debug statement left in application code (1 occurrence)
source code · Potential risk, needs review · security · sec.debug-statement
dd(), dump() and var_dump() print internal data to the response and halt or disturb normal output when reached in production.
Evidence
- app/Http/Controllers/ReportController.php:23: dd($rows);
Remediation
Remove debugging calls before deploying; use logging for diagnostics.
INFO51. No static analysis tool is installed
composer.json · Confirmed · quality · quality.no-static-analysis
Static analysis finds type errors and dead code before they reach production, and makes refactoring safer.
Evidence
None of phpstan/phpstan, larastan/larastan or vimeo/psalm is required.
Remediation
Add Larastan: composer require --dev larastan/larastan, then start at a low level and raise it over time.
INFO52. No code style tool is installed
composer.json · Confirmed · quality · quality.no-code-style
A formatter keeps diffs focused on behaviour and avoids style discussions in reviews.
Evidence
None of laravel/pint, friendsofphp/php-cs-fixer or squizlabs/php_codesniffer is required.
Remediation
Add Laravel Pint (composer require --dev laravel/pint) and run it in CI with --test.
INFO53. No continuous integration configuration found
project root · Potential risk, needs review · quality · quality.no-ci
Without CI, tests and checks depend on each developer remembering to run them. CI may be configured outside the repository (e.g. in a hosting platform).
Evidence
None of: .github/workflows, .gitlab-ci.yml, bitbucket-pipelines.yml, .circleci/config.yml, Jenkinsfile, azure-pipelines.yml, .travis.yml.
Remediation
Add a pipeline that runs composer install, the test suite, static analysis, the formatter in check mode and composer audit.