Most security bugs in Laravel apps are small and repeated: a whereRaw with a variable, $guarded = [], {!! $input !!} in a view, a forgotten dd(), a dependency with a known CVE. Checkpoint finds them in seconds, on your laptop and in CI, so they never reach the server.
Key ideas, in plain words#
| Term | Meaning |
|---|---|
| SAST | Static analysis: reading code (not running it) to find risky patterns |
| CVE | A publicly known vulnerability in a package or program |
| CI | The pipeline that runs on every push (GitHub Actions, GitLab CI) |
| Gate | A step that stops the pipeline when something is wrong |
| Suppression | Accepting one specific finding on purpose, by its hash |
You run php artisan checkpoint:scan before committing, like a test.
The pipeline starts.
The same scan runs in CI. A FAIL exits with code 1 and the pipeline stops: nothing is deployed.
If the scan (and your tests) pass, the pipeline deploys with Cipi (CI/CD guide).
Before you start#
- A Laravel project (8 to 13) on PHP 8.1 or newer.
- For the CI part: a repository on GitHub or GitLab, deployed with Cipi.
1. Install#
composer require --dev andreapollastri/checkpoint
--dev because it's a development tool: it's not installed on production (Cipi deploys with --no-dev).
2. Run it#
$ composer require --dev andreapollastri/checkpoint $ php artisan checkpoint:scan $ php artisan checkpoint:github
php artisan checkpoint:scan
Each check prints PASS, WARN or FAIL, with the file and line and a short hash in brackets.
| Result | Meaning | Do |
|---|---|---|
| PASS | Nothing found | Nothing |
| WARN | Possibly risky, needs a human look | Review; fix or suppress |
| FAIL | Likely a real problem | Fix before deploying |
Useful options:
php artisan checkpoint:scan --only="SQL Injection Risks,CSRF Protection" php artisan checkpoint:scan --skip="NPM CVE Audit" php artisan checkpoint:scan --fail-on-warn php artisan checkpoint:scan --json | tee checkpoint-report.json
3. What it checks#
| Area | Checks |
|---|---|
| Dependencies | Composer CVE audit, npm CVE audit, PHP CVE audit, outdated and abandoned packages, package freshness (supply chain), supply-chain tooling, Composer configuration, suspicious vendor autoload |
| Configuration | Environment (APP_DEBUG, APP_KEY…), .gitignore for sensitive files, file permissions, CORS, session and cookie security, PHP php.ini, EOL versions, public directory exposure |
| Code | SQL injection, mass assignment, XSS, CSRF, open redirect, command injection, insecure deserialization, SSRF, TLS verification turned off, path traversal, weak cryptography, insecure random numbers, XXE, hardcoded secrets, debug functions, sensitive data exposure |
4. Fix the classic ones#
| Finding | Risky | Safer |
|---|---|---|
| SQL injection | ->whereRaw("total > $min") | ->whereRaw('total > ?', [$min]) or ->where('total', '>', $min) |
| Mass assignment | protected $guarded = []; | protected $fillable = ['name', 'email']; |
| XSS | {!! $comment->body !!} | {{ $comment->body }}, or sanitize HTML first |
| Open redirect | redirect($request->input('next')) | redirect()->intended('/dashboard') or an allowlist |
| SSRF | Http::get($request->url) | Validate the host against an allowlist |
| TLS off | Http::withoutVerifying() | Remove it; fix the certificate instead |
| Debug left | dd($order) in a controller | Remove it; use logs |
5. Accept a finding on purpose#
Sometimes a pattern is fine (a whereRaw with a constant, for example). Publish the config and add the finding's hash:
php artisan vendor:publish --tag=checkpoint-config
// config/checkpoint.php
'suppressed' => [
'7d02be', // ReportController: whereRaw with a constant, reviewed 2026-11
],
'exclude_paths' => ['legacy/'],Leave a comment with each hash so the next person knows why.
6. Block risky code in CI#
GitHub Actions, generated for you:
php artisan checkpoint:github # writes .github/workflows/checkpoint.ymlIt runs on pushes to main/master and on pull requests, installs dependencies, runs the scan and uploads checkpoint-report.json as an artifact. GitLab: php artisan checkpoint:gitlab.
To make it a gate before your Cipi deploy, put the scan in the same workflow, before the deploy job:
jobs:
checkpoint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with: { php-version: '8.5', coverage: none }
- run: composer install --prefer-dist --no-progress --no-interaction
- run: php artisan checkpoint:scan
deploy:
needs: checkpoint # runs only if the scan passed
runs-on: ubuntu-latest
steps:
- uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.SERVER_HOST }}
username: cipi
key: ${{ secrets.CI_SSH_KEY }}
script: sudo cipi deploy shop || (sudo cipi deploy shop --rollback && exit 1)Turn off the app's push webhook so only the pipeline deploys (CI/CD guide).
7. Also on every composer install (optional)#
php artisan checkpoint:install-hooks # adds the scan to post-install/post-update
php artisan checkpoint:install-hooks --removeCheckpoint, Hackly and Cipi together#
| Layer | Tool | When |
|---|---|---|
| Your code, before deploy | Checkpoint | Every push |
| Your running sites and repositories | Hackly | Weekly, before releases |
| The server | Cipi | Every night: PHP patches, services, firewall, integrity scans |
Troubleshooting#
| Problem | Fix |
|---|---|
| Composer/npm audit says it can't run | Install the tool in CI, or skip that check with --skip |
| Environment check fails in CI | It reads CI's environment: set APP_DEBUG=false there, or skip it in CI |
| Too many WARNs on old code | Fix FAILs first; suppress reviewed WARNs by hash; tighten with --fail-on-warn later |
| Package freshness FAIL | A dependency was released in the last 3 days: wait, or whitelist it in package_freshness |
| Pipeline passes but deploys anyway on push | The webhook is still on: remove it from the repository |
Questions
What is Checkpoint?
A free (MIT) Composer package by Andrea Pollastri that scans a Laravel project for common security mistakes and vulnerable dependencies in seconds: 33 checks from SQL injection risks to CORS, CSRF, secrets and EOL versions.
Is it a full SAST tool?
No, and it says so: most code checks are fast pattern matches, focused on Laravel. Expect some false positives and misses. It's a quick gate; pair it with deeper scanning such as Hackly.
Which versions?
PHP 8.1 to 8.6, Laravel 8 to 13.
Will it block my deploy?
Only if you make it: in CI, a FAIL exits with code 1 and stops the pipeline before the deploy step. Warnings pass unless you add --fail-on-warn.
How do I silence a false positive?
Copy its hash (shown next to the finding) into suppressed in config/checkpoint.php. Review that list now and then.
Does it check production settings?
Environment checks read the config of the process running Artisan. In CI that's the CI environment, not production. Check production's .env separately (cipi app env shop --get=APP_DEBUG).
Can I add my own checks?
Yes: extend AbstractCheck, return a CheckResult, and register the class in extra_checks.