Download the PHP package ruvelo/laravel-security-alerts without Composer
On this page you can find all versions of the php package ruvelo/laravel-security-alerts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ruvelo/laravel-security-alerts
More information about ruvelo/laravel-security-alerts
Files in ruvelo/laravel-security-alerts
Package laravel-security-alerts
Short Description Tells you when a package your Laravel app runs becomes vulnerable, and when a known flaw starts being exploited in the wild. Valtry's signed Advisory API or the public feeds (Packagist, OSV, CISA KEV), no keys.
License MIT
Homepage https://ruvelo.github.io/laravel-security-alerts/
Informations about the package laravel-security-alerts
Live demo Configuration Developer guide Changelog
Laravel Security Alerts
Know when a dependency turns dangerous. composer audit only runs when someone types it. This package checks the exact Composer and npm versions your app runs every day, tells you once when one becomes vulnerable, and again when attackers start exploiting it in the wild.
That's all: the daily check schedules itself. Try php artisan security-alerts:check now, or see what it found in a made-up app in the live demo.
A quick tour
Exploited now, patch today. Advisories are matched against CISA's catalogue of known exploited vulnerabilities. A flaw that attackers are using goes to the top, whatever its score, with the day CISA listed it and the version that fixes it.
In your terminal and in CI. php artisan security-alerts:check prints the same report. --fail-on=exploited fails a pipeline, --json feeds anything else.
| One email for everything new, exploited first, through your own mailer. Never the same alert twice. | The demo is rendered by the package from real advisories, light, dark and at phone width. |
Features
- Composer and npm: exact versions from
composer.lockand, if you have one,package-lock.json(lockfile versions 1 to 3). Missing files are fine. - Exploited in the wild first: CVEs in CISA's KEV catalogue are marked, with the date added and the due date, and ranked above everything else.
- What to update to: the fixed version is worked out from the advisory's ranges with
composer/semver, including ranges split by minor version. When an advisory only names the last affected release, it says so (>2.10.1). - Quiet: each finding is sent once, and once more if it becomes exploited. Fixed ones are closed when the package is updated. A failed feed never closes anything, and a
cache:clearnever re-sends. - Mail, Slack and your own notifiables, plus events (
VulnerabilityFound,VulnerabilityExploited,VulnerabilityResolved) to hook anything else. - Scheduled for you: a daily check at 07:00, an optional weekly digest.
- CI-ready command:
--fail-on=exploited|critical|high|medium|any,--json, exit code 2 when it couldn't check everything. - No keys: signed answers from Valtry's Advisory API (package names only, never versions), or Packagist, OSV.dev and CISA directly, which is also the automatic fallback and the opt-out (
SECURITY_ALERTS_SOURCE=public). - Optional extras: a Laravel Pulse card, a spatie/laravel-health check, an MCP tool for AI agents and Laravel Boost guidelines. None is required.
Watching many sites? Valtry scans them from the outside.
Requirements
- PHP 8.3+
- Laravel 12 or 13, with the scheduler running
- For Slack:
composer require laravel/slack-notification-channel(3.6 or later)
Where it looks, and what it sends
By default a check asks Valtry's Advisory API, and uses the public feeds whenever Valtry can't answer. Both give the same findings; the scanning, matching and comparing are done by ruvelo/security-advisories, the core shared by Ruvelo's security packages.
| Source | For | What leaves your server |
|---|---|---|
| Valtry Advisory API (default) | Composer and npm packages, and which advisories CISA lists as exploited | Package names only, and a random nonce. Never versions: they are matched on your server |
Packagist security advisories (fallback, or public) |
Composer packages. It's the API composer audit uses, fed by the GitHub Advisory Database and FriendsOfPHP |
Package names, in a POST of up to 200 at a time |
OSV.dev (fallback, or public) |
npm packages from package-lock.json |
Package names and versions; then each matching advisory is fetched by its ID |
CISA KEV (fallback, or public) |
Which CVEs are being exploited | Nothing: the catalogue is downloaded whole |
- Signed answers. Valtry's answers carry an Ed25519 signature that is checked against keys built into the package (needs PHP's
sodiumextension), along with the nonce and the list of packages asked about. An answer that fails any check is discarded. - Automatic fallback. If Valtry can't be reached within 5 seconds, answers with an error, sends an answer that doesn't verify, or says its data is stale, that check uses Packagist, OSV and CISA directly, and Valtry is left alone for five minutes. The command, the report and
--jsonsay which path answered ("Checked 67 Composer and 38 npm packages via Valtry, signed" or "via public feeds"). - Opt out. Set
SECURITY_ALERTS_SOURCE=public(or'source' => 'public'in the config) to never contact Valtry.RUVELO_ADVISORIES_SOURCE=publicin the environment does the same and wins over the config. - Valtry doesn't log the names it is sent or pair them with your address; its privacy terms are on the API page.
Nothing about your app is sent: no URL, no environment, no code. Requests identify themselves as ruvelo/laravel-security-alerts. Answers are cached (an hour for advisories, six hours for the catalogue), so running the command twice is instant; --fresh skips the cache. Use a mirror or Private Packagist by changing sources.packagist.url. HTTP goes through Guzzle; to use your own PSR-18 client (a proxy, say), bind it to Psr\Http\Client\ClientInterface.
The command
| Option | |
|---|---|
--fail-on=exploited |
Exit with 1 when a finding is at least this bad: exploited, critical, high, medium or any. Exploited findings count at every level |
--json |
Print the report as JSON |
--notify |
Remember findings and send alerts for new ones. This is what the scheduler runs; without it, the command changes nothing |
--fresh |
Ignore cached feeds |
Exit codes: 0 fine, 1 a finding reached --fail-on, 2 a lockfile or feed couldn't be read, so the answer is incomplete.
In GitHub Actions, after composer install:
How it remembers
What it has seen lives in one small table, security_alerts (the migration loads automatically). A table rather than the cache, because deploys often run cache:clear, and a cleared cache would send every old alert again. It also gives each finding a history: when it was first seen, when it was sent, when it became exploited, when it was fixed.
A finding is one advisory on one package. It's new the first time a check sees it, or if it comes back after being fixed. It's exploited the first time the check sees its CVE in CISA's catalogue. It's resolved when a complete check of its ecosystem no longer finds it. Alerts that couldn't be sent (no one configured yet, mail down) wait for the next check.
Configuration
Everything works without configuration. To change the defaults:
| Key | Default | |
|---|---|---|
notify.mail |
[] (SECURITY_ALERTS_MAIL, comma-separated) |
Who gets the email |
notify.slack |
null (SECURITY_ALERTS_SLACK_WEBHOOK) |
An incoming webhook URL |
notify.via |
['mail'] |
Channels for the notifiables you register with SecurityAlerts::notifyUsing() |
notify.min_severity |
null (SECURITY_ALERTS_MIN_SEVERITY) |
Skip new findings below critical, high, medium or low. Exploited ones are always sent |
schedule.enabled |
true (SECURITY_ALERTS_SCHEDULE) |
Schedule the daily check |
schedule.time, schedule.timezone |
07:00 (SECURITY_ALERTS_TIME), app timezone |
When |
digest.enabled |
false (SECURITY_ALERTS_DIGEST) |
A weekly email of everything still open, even when nothing changed |
digest.day, digest.time |
monday, 08:00 |
When |
composer.lockfile |
base_path('composer.lock') |
|
composer.include_dev |
false |
Dev packages aren't deployed, so they're left out |
npm.enabled |
true |
Check package-lock.json when there is one |
npm.lockfile |
base_path('package-lock.json') |
|
npm.include_dev |
true |
Laravel apps list axios, Alpine and friends as devDependencies because Vite bundles them, so they count |
source |
valtry |
valtry or public (SECURITY_ALERTS_SOURCE) |
valtry_url |
Valtry's Advisory API | |
sources.packagist.url, sources.osv.url, sources.kev.url |
the public feeds | For mirrors |
sources.kev.enabled |
true |
Download CISA's catalogue; Valtry's answers carry the exploited verdict regardless |
cache.store |
null (SECURITY_ALERTS_CACHE_STORE) |
Your default store when null |
cache.advisories_ttl, cache.kev_ttl, cache.osv_details_ttl |
1 hour, 6 hours, 1 week | In seconds |
http.timeout, http.tries |
15, 2 |
Per request |
table |
security_alerts |
|
run_migrations |
true |
Set to false after vendor:publish --tag=security-alerts-migrations to run your own copy |
mcp.* |
off | See MCP |
Customising the look
The email is a standard Laravel Markdown mail, so it uses your app's mail theme. To change its wording or layout:
and edit resources/views/vendor/security-alerts/mail/alerts.blade.php (the Pulse card's view is next to it). To replace the notification altogether, listen to the events and send your own.
For developers
PHP API
Finding |
Type | |
|---|---|---|
package, installed |
string |
livewire/livewire, 3.6.2 |
ecosystem |
Ecosystem |
Composer or Npm |
advisoryId, title, link, cve |
string, ?string |
PKSA-… (Packagist) or GHSA-… (OSV) |
severity |
Severity |
Critical, High, Medium, Low, NotRated (older advisories have none; 1.0 called it Unknown) |
fixedIn |
?string |
3.6.4, >2.10.1, or null when no fix is known |
exploited |
?KevEntry |
cve, name, dateAdded, dueDate, ransomware |
isDev |
bool |
A dev dependency |
These classes now live in ruvelo/security-advisories (Ruvelo\SecurityAdvisories\Finding, Report, Severity, Ecosystem, KevEntry, Threshold); the old Ruvelo\SecurityAlerts\... names still resolve. dateAdded and dueDate are DateTimeImmutable. Report::$source is valtry, public or mixed.
Report and Finding are JsonSerializable; --json prints the report with version added beside installed on each finding:
The Ruvelo\SecurityAlerts\Models\SecurityAlert model is the stored finding (scopes open(), exploited(), worstFirst(); present() gives the same shape plus first_seen_at, last_seen_at, resolved_at). Only SecurityAlerts::check() writes it; writing to it yourself would break "send once".
Events
| Event | Fires when | Has |
|---|---|---|
VulnerabilityFound |
A check sees a finding for the first time, or again after it was fixed | $alert |
VulnerabilityExploited |
A finding's CVE is in CISA's catalogue for the first time, new or not | $alert |
VulnerabilityResolved |
A complete check no longer finds it | $alert |
Exceptions
All extend Ruvelo\SecurityAlerts\Exceptions\SecurityAlertsException: NotInstalled (the migration hasn't run), LockfileUnreadable, SourceUnavailable (with $source) and InvalidThreshold. scan() and check() turn lockfile and feed failures into $report->problems rather than throwing.
Laravel Pulse
With Pulse installed, add the card to resources/views/vendor/pulse/dashboard.blade.php:
It lists open alerts, exploited first, from the table: it never calls a feed.
Health checks
With spatie/laravel-health:
It also warns when no check has run for 48 hours, which usually means the scheduler stopped.
MCP for AI agents
With laravel/mcp installed and SECURITY_ALERTS_MCP=true, agents get a read-only list_security_alerts tool (filters: exploited_only, min_severity) through php artisan mcp:start security-alerts. Set mcp.path to serve it over HTTP too, behind mcp.middleware (auth:sanctum by default).
Laravel Boost
If your app uses Laravel Boost, php artisan boost:install picks up this package's guidelines, so your coding agent runs the check after updating dependencies, fixes exploited findings first, and doesn't write to the alerts table or call the feeds itself.
In your tests
Fake the feeds with Http::fake() (URLs under packagist.org/api/security-advisories/, api.osv.dev/v1/ and www.cisa.gov/), and use the factory for anything that reads alerts:
Contributing
Pull requests are welcome. Clone, composer install, then composer check runs code style (Pint), static analysis (PHPStan level 8) and the tests, exactly as CI does. The tests never touch the network: feeds are answered from recorded responses in tests/fixtures. See changelog.
The demo and screenshots are built from the package itself: composer demo writes the static demo into build/, and demo/screenshots.sh regenerates art/.
Credits
Built by François Bultez at Valtry, the website security scanner, and everyone who contributes.
Advisories come from Packagist (and through it the GitHub Advisory Database and FriendsOfPHP/security-advisories), OSV.dev and CISA. Thanks to everyone who maintains them.
License
MIT. See LICENSE.
All versions of laravel-security-alerts with dependencies
guzzlehttp/guzzle Version ^7.8.2
laravel/framework Version ^12.4.1|^13.0
ruvelo/security-advisories Version ^1.1