Download the PHP package ruvelo/security-advisories without Composer

On this page you can find all versions of the php package ruvelo/security-advisories. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package security-advisories

Tests PHP 8.2+ PHPStan level 8

Security Advisories

The core behind Ruvelo's security alerts for Laravel, Symfony, Shopware, PrestaShop, Joomla and more. It reads a project's lockfiles, asks Packagist and OSV which installed versions are vulnerable, marks what CISA says attackers are exploiting, and works out what changed since last time. No framework, no storage, no notifications: those belong to the platform modules built on it, so a fix here reaches all of them.

You also need a PSR-18 client and PSR-17 factories. If your app has Symfony HttpClient or Guzzle, you have one; otherwise composer require symfony/http-client nyholm/psr7.

Usage

Scanner::forProject() takes a JsonClient if you want to pass your own PSR-18 client and factories (new JsonClient($client, $requestFactory, $streamFactory)); without one, php-http/discovery finds them.

What it gives you

Class What it is
Scanner scan(bool $fresh = false): Report. Never throws for a missing file or a failing feed.
Report Immutable. findings (worst first), counts(), worst(), exploited(), failing($t), failsOn($t), isClean(), isComplete(), problems, unchecked (packages no source covers: an inventory, not a problem), notes (non-fatal remarks), toArray() / Report::fromArray(), source (valtry, public or mixed) and sources per ecosystem, toArray() / JSON.
Finding Immutable. Package, installed version, advisory id, title, link, CVE, Severity (including NotRated), fixedIn, exploited (a KevEntry with dates added and due, and ransomware use), isDev, and a stable key(), aliases, links, the installed package's metadata, and toArray() / Finding::fromArray() in a versioned shape (v).
Reconciler reconcile($known, $report, $lastSeen = []): Changes, next($known, $report, $unacknowledged = []) and lastSeen(). Stores nothing. An incomplete report never resolves anything; unacknowledged keys stay news until delivered.
Versions affects() and fixedIn() on composer/semver. Follows patch lines and minor-split ranges; says >2.10.1 when an advisory only names the last affected release.

Data sources

By default a scan asks Valtry first and the public feeds whenever Valtry can't answer. Both paths give the same findings: Valtry serves the same Packagist, OSV and CISA KEV data, normalised, from one request per ecosystem.

Path Used for What leaves your server
Valtry Advisory API (default) Composer and npm packages, and whether each advisory is exploited (CISA KEV) Package names only, and a random nonce. Never versions: they are matched locally with composer/semver.
Packagist (fallback, or opted out) Composer packages Package names only. Versions are matched locally.
OSV.dev (fallback, or opted out) npm packages Names and exact versions of npm packages, then advisory ids.
CISA KEV (fallback, or opted out) Exploited in the wild Nothing: the whole catalogue is downloaded.

Valtry doesn't log or store the names it is sent, or pair them with your address. Its privacy terms are on the API page.

Signed answers. Every Valtry answer carries an Ed25519 signature (X-Valtry-Signature: ed25519=…; kid=…) over its exact body. The library verifies it against public keys pinned in src/Valtry/Keys.php, never against a key it downloads, and checks that the answer echoes the request's nonce and covers every name asked about. A hijacked DNS record, a TLS-intercepting proxy or a replayed old answer fails those checks. Verification needs ext-sodium, which PHP bundles.

Fallback. For each ecosystem, the public feeds answer instead when Valtry:

After a network failure, an error or a bad signature, Valtry is left alone for five minutes (in your PSR-16 cache, if you pass one). $report->source says which path answered (valtry, public, or mixed when they differed), and $report->sources has it per ecosystem. An ecosystem never gets half an answer from each.

The 5 seconds are enforced by the HTTP client: without a client of your own, the library builds one with that timeout from Symfony HttpClient or Guzzle when either is installed; a Symfony Psr18Client you pass gets a copy with the timeout. With another client, give it a short timeout yourself: an answer that arrives late is still discarded, but only after it arrives.

Fail-closed until a key is pinned. While Keys::PINNED holds a placeholder, the Valtry path sends nothing and every scan uses the public feeds. CI refuses to build a tag with a placeholder left. To pin the key, run php artisan advisories:keygen on Valtry, paste the printed 'kid' => 'base64', line into Keys::PINNED, release, and only then switch Valtry to the new key. To rotate keys, add the new kid beside the old one, release, switch Valtry, and drop the old kid a release later.

Opting out. To never contact Valtry, pass source: 'public':

or set RUVELO_ADVISORIES_SOURCE=public in the environment. The environment variable wins over code, so a server's owner can opt out without touching an adapter's configuration.

Everything goes through the PSR-18 client you give it, and is cached with PSR-16 if you pass a cache (advisories one hour, KEV six hours, OSV details one week; change them with Ttls). No keys, no accounts, no other requests.

Extension points

Options for adapters

Writing an adapter

An adapter is a platform's glue: it knows what is installed, where to store results and how to tell people. The core does the rest.

  1. Inventory. Turn the platform's extension list into InstalledPackages (an ExtensionList). Use Ecosystem::Composer or Ecosystem::Npm for what Packagist or OSV cover, Ecosystem::Extension for the rest, and metadata for what you want to show later.
  2. Advisories. For a platform feed, implement AdvisorySource (supports(), find()): return AdvisoryMatches for the exact versions, fill affectedVersions when you can read the ranges, and throw SourceUnavailable if the feed can't be read in full. Implement EmitsNotes to flag what you couldn't judge.
  3. Scan. Scanner::forProject($root, ecosystems: [...], extraSources: [...], extraPackageSources: [...]), or new Scanner(...) when there is no lockfile. Pass your platform's PSR-18 client and PSR-16 cache through JsonClient and cache:, or the built-in CurlClient and FileCache.
  4. Decide. Show $report->findings; tell people when ! $report->isComplete() (problems), and list unchecked and notes apart from findings.
  5. Remember. Store $reconciler->next(...), lastSeen(...) and the report's toArray(), reconcile on the next run, and notify on Changes::$new and Changes::$exploited.

Development

composer check runs code style (Pint, PSR-12), static analysis (PHPStan level 8) and the tests, exactly as CI does. The tests never touch the network: a mock PSR-18 client serves real recorded responses from tests/fixtures. See changelog.

Credits

Built by François Bultez at Valtry, the website security scanner, and everyone who contributes.

Advisories come from Valtry, 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 security-advisories with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
composer/semver Version ^3.4
php-http/discovery Version ^1.19
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1|^2.0
psr/simple-cache Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ruvelo/security-advisories contains the following files

Loading the files please wait ...