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.

Not all 15 are equally proven. Each analyzer below is rated from evidence: 7 are production-ready (backed by labeled corpus cases and producing findings on real Laravel applications), 7 are partial (working but narrowly exercised), and 1 is a stub. Precision and recall are measured against a labeled corpus run in CI on every commit with a ratchet. Those case counts are small — two or three cases cannot establish a precision figure, which is why no per-analyzer rate is quoted here. Findings are also scored against pinned real applications to measure behaviour under the noise of a working codebase.

1. Authorization Coverage

authorization-coverage HAVOC-AUTH-001 – 002
HIGH

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

mass-assignment HAVOC-MA-001 – 003
HIGH

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 $fillable nor $guarded
  • Privilege-bearing columns inside $fillable

Production-ready 3 corpus cases; 23 and 8 findings on real applications.

3. XSS / Blade Output

xss-blade HAVOC-XSS-001 – 002
MEDIUM

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

sql-injection HAVOC-SQL-001 – 002
CRITICAL

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 BY columns
  • 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

idor HAVOC-IDOR-001 – 002
MEDIUM

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

privilege-escalation HAVOC-PE-001 – 003
HIGH

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

credential-exposure HAVOC-CRED-001 – 008
CRITICAL

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_DEBUG or APP_ENV set unsafely

Partial No corpus cases yet, so precision and recall are unmeasured. It does produce real findings on real applications.

8. Session Security

session-security HAVOC-SESS-001 – 007
MEDIUM

Analyses session and cookie configuration: secure and HTTP-only flags, SameSite policy, lifetime, driver, and routes excluded from CSRF verification.

Detects

  • secure or http_only disabled on session cookies
  • A permissive or unset same_site policy
  • Routes listed in the CSRF exception list

Production-ready 2 corpus cases; 2 and 2 findings on real applications.

9. File Upload

file-upload HAVOC-UPLOAD-001 – 005
HIGH

Detects insecure upload handling — missing type or size validation, and uploads written where they can be served back.

Detects

  • Uploads stored with no mimes: or max: 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

rate-limit HAVOC-RL-001 – 002
MEDIUM

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

encryption HAVOC-ENC-001 – 003
HIGH

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 $fillable with 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

deserialization HAVOC-DESER-001 – 007
HIGH

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_classes restriction

Partial 3 corpus cases. Fired on one of the two real applications.

13. Open Redirect

open-redirect HAVOC-REDIRECT-001 – 002
MEDIUM

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

security-headers HAVOC-HEADER-001 – 004
LOW

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

dependency-audit HAVOC-DEP-001 – 002
MEDIUM

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 audit could 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.