talira

Psalm Laravel plugin

Laravel static analysis and taint-based security scanning for Psalm

open sourceMITfree

The Psalm Laravel plugin adds Laravel-aware static analysis to Psalm, with taint analysis that traces user input from request to sink to find SQL injection, XSS, shell injection, file traversal, SSRF, open redirects, timing-unsafe secret comparisons and prompt injection in laravel/ai agents. It boots the Laravel application to resolve facades, config and Eloquent model metadata, adds 13 Laravel-specific checks, can analyse Blade templates, and writes a GitHub Actions workflow that uploads findings to GitHub Code Scanning. Everything runs in your own project and CI. It's maintained in the psalm GitHub organization, separate from Psalm itself.

Problems it solves

  • find SQL injection and XSS in a Laravel app before it ships
  • run static analysis that understands Laravel facades and Eloquent models
  • add security scanning of a Laravel codebase to CI without a paid tool

Features

  • Taint analysis from Laravel request input to SQL, HTML, shell, file, HTTP and redirect sinks
  • 13 Laravel-aware checks such as undefined model relations and unknown model attributes
  • Opt-in analysis of Blade templates
  • Boots the Laravel app to resolve facades, config and Eloquent models
  • Generates a GitHub Actions workflow that uploads findings to Code Scanning
  • Runs locally and in CI with no account or cloud upload

Limitations

  • Version 4.x needs PHP 8.2+, Laravel 12 or 13 and Psalm 7; Laravel 11 needs the 3.x line1
  • A run executes the project's own PHP (config, service providers and container bindings), so it shouldn't be run on an untrusted checkout outside a sandbox1

Alternatives

The same job

These do what Psalm Laravel plugin does.

  1. Larastan Adds code analysis to Laravel, improving developer productivity and code quality
  2. PHPStan PHP static analysis that finds bugs without running your code
  3. Psalm Free and open source static analysis tool for finding errors in PHP code

Compare Psalm Laravel plugin with the top 3