@havoc-security/cli
v0.5.2
Published
HAVOC — Laravel-native security scanner CLI. Free to use; free to use under BSL 1.1.
Maintainers
Readme
@havoc-security/cli
Framework-aware security scanning for Laravel. Parses your PHP into an AST and
applies Laravel's own security model — policies, Gates, middleware, $fillable —
rather than pattern-matching your source.
npx @havoc-security/cli scanNo account required. No data leaves your machine unless you configure HAVOC Cloud.
Install
npm install -g @havoc-security/cli
havoc scanRequires Node 20+. HAVOC analyses PHP but is written in TypeScript, so it is an npm package rather than a Composer one.
Usage
havoc scan # scan the current directory
havoc scan apps/api # scan a subdirectory
havoc scan --format json # machine-readable output
havoc scan --fail-on high # exit non-zero on high+ findings (for CI)
havoc scan --diff main # only files changed since a git ref
havoc scan --severity medium # hide findings below a severity
havoc baseline # record current findings, report only new ones
havoc init # write a .havoc.yml--format json writes the full result to stdout:
{
"findings": [ /* id, severity, analyzer, file, line, recommendation, cwe */ ],
// Controller actions with a detectable authorization check — the headline.
"authorizationCoverage": { "coveredActions": 29, "totalActions": 60 },
// Route-level AUTHENTICATION, a different question. `coveragePercent` is a
// deprecated alias of `routeAuthPercent`; don't read it as the headline.
"coverage": { "totalRoutes": 52, "coveredRoutes": 43, "routeAuthPercent": 83 },
"metadata": { "filesScanned": 314, "durationMs": 770, "scannerVersion": "0.2.0" },
"grade": "F"
}Analyzers
Fifteen, all Laravel-specific: authorization coverage, mass assignment, SQL injection, XSS surface, IDOR, privilege escalation, credential exposure, session security, file upload, rate limiting, encryption at rest, insecure deserialization, open redirect, security headers, and dependency audit.
Maturity varies per analyzer. Precision and recall are measured against a
labeled corpus in the repository (corpus/) plus a realism corpus of real
Laravel applications (corpus-realism/), both run in CI.
Configuration
.havoc.yml in the directory being scanned:
framework: laravel
paths:
controllers: app/Http/Controllers
models: app/Models
routes: routes
fail_on: high
ignore:
- id: HAVOC-MA-002
reason: "Legacy admin model, tracked in TICKET-123"Every ignore entry requires a reason, to prevent silent suppression.
CLI flags always override .havoc.yml.
CI
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npx @havoc-security/cli scan --fail-on highLicence
Business Source License 1.1 — free to use, not open source. Read,
modify, self-host, and run in production, including on your employer's code and
in your own CI. The one restriction is offering HAVOC as a competing hosted
service. Converts to Apache 2.0 on 2030-03-01. See LICENSE.md.
