Framework Analyzers
HAVOC ships with 15 Laravel-specific security analyzers. Each parses your PHP into an AST rather than matching patterns against raw text, so it can take surrounding context into account.
1. Authorization Coverage
Reports controller actions with no detectable authorization check. Route-aware: resolves group-inherited middleware, can: rules, policy-backed FormRequests, and gates applied in a controller's constructor before flagging anything.
Detects
- Public controller actions with no policy, Gate or
can:middleware - Actions behind an authentication wall but with no fine-grained authorization (reported LOW)
- Project-wide coverage below the configured minimum
Production-ready 9 corpus cases; 34 and 205 findings on the two real applications scanned.
2. Mass Assignment
Detects Eloquent models exposed to mass assignment. Reads $fillable and $guarded before flagging, and requires the class to actually extend a model base — a presenter or DTO living in app/Models is not a model.
Detects
$guarded = [], which disables protection entirely- Models declaring neither
$fillablenor$guarded - Privilege-bearing columns inside
$fillable
Production-ready 3 corpus cases; 23 and 8 findings on real applications.
3. XSS / Blade Output
Identifies unescaped Blade output that can carry user-controlled data into the page.
Detects
{!! !!}echoing request input or model attributes- Unescaped output inside HTML attributes
Partial 2 corpus cases. Fired on one of the two real applications, not the other.
4. SQL Injection
Finds raw SQL built from user-controlled input. Parameterised calls are ignored, whether the bindings are passed to whereRaw() or to DB::select().
Detects
- Request input concatenated or interpolated into raw SQL
- User-controlled
ORDER BYcolumns - Raw SQL composed at runtime by
sprintf()or a helper
Production-ready 3 corpus cases; 9 and 12 findings on real applications.
5. Insecure Direct Object Reference
Flags nested parent/child routes (/users/{userId}/posts/{postId}, nested resources) whose handling controller shows no ownership check. Ownership is resolved against the controller the route dispatches to.
Detects
- Nested routes whose controller fetches by ID with no ownership predicate
- Nested resource routes with no scoping through the authenticated user
Production-ready 3 corpus cases; 5 and 10 findings on real applications.
6. Privilege Escalation
Detects paths where a user could grant themselves or others elevated access. Understands Spatie Laravel-Permission's role and permission APIs.
Detects
- Privilege fields (
role,is_admin,account_type) in$fillable - Role or permission assignment with no preceding authorization check
- Admin routes with no admin middleware
Partial 2 corpus cases, but it produced no findings on either real application. Unproven outside fixtures.
7. Credential Exposure
Detects secrets hardcoded in tracked source, plus configuration that leaks in production. Uses entropy analysis alongside provider-specific patterns.
Detects
- Hardcoded passwords and API tokens
- AWS, Stripe and GitHub credentials matching known formats
- Private key blocks committed to tracked files
APP_DEBUGorAPP_ENVset unsafely
Partial No corpus cases yet, so precision and recall are unmeasured. It does produce real findings on real applications.
8. Session Security
Analyses session and cookie configuration: secure and HTTP-only flags, SameSite policy, lifetime, driver, and routes excluded from CSRF verification.
Detects
secureorhttp_onlydisabled on session cookies- A permissive or unset
same_sitepolicy - Routes listed in the CSRF exception list
Production-ready 2 corpus cases; 2 and 2 findings on real applications.
9. File Upload
Detects insecure upload handling — missing type or size validation, and uploads written where they can be served back.
Detects
- Uploads stored with no
mimes:ormax:validation - Files written into a publicly served directory
- Client-supplied filenames used as storage paths
Partial 2 corpus cases. Fired on one of the two real applications.
10. Rate Limiting
Flags routes with no throttle middleware, weighted toward authentication endpoints and state-changing verbs.
Detects
- Authentication and password-reset routes with no throttle
- Write operations with no rate limit
Production-ready 2 corpus cases; 5 and 5 findings on real applications. Highest-volume analyzer — tune it in .havoc.yml.
11. Encryption at Rest
Flags sensitive columns that are mass-assignable without an encrypted cast — API keys, tokens, SSNs, bank and card numbers in $fillable with no encrypted cast. It checks encryption at rest on Eloquent models; it does not inspect hashing algorithm choice.
Detects
- Sensitive fields in
$fillablewith no encrypted cast - Sensitive fields cast to a plaintext type such as
string
Partial 3 corpus cases. On real applications it so far only raises the advisory key-rotation finding.
12. Insecure Deserialization
Detects unserialize() and related sinks reached by user-controlled input, which can lead to object injection.
Detects
unserialize()applied to request input, cookies or session data- Missing
allowed_classesrestriction
Partial 3 corpus cases. Fired on one of the two real applications.
13. Open Redirect
Detects redirects whose destination comes from user input without validation against an allowlist.
Detects
redirect()given a value taken from the request- Redirect targets built by concatenating user input
Partial 4 corpus cases. Fired on one of the two real applications.
14. Security Headers
Checks whether the application sets the response headers that mitigate clickjacking, MIME sniffing and mixed content, and whether HTTPS is enforced.
Detects
- No Content-Security-Policy configured
- Missing X-Frame-Options or X-Content-Type-Options
- No HTTPS enforcement detected
Production-ready 2 corpus cases; 7 and 2 findings on real applications.
15. Dependency Audit
Runs composer audit against your lockfile and reports packages with known advisories. Requires Composer 2.4+ on PATH; when it is absent, HAVOC says so rather than reporting a clean result.
Detects
- Dependencies matching published security advisories
- An informational finding when
composer auditcould not run
Stub No corpus cases. Shells out to composer audit; on both real applications the only output was the "audit unavailable" diagnostic. Effectively unexercised.