Use this file to discover all available pages before exploring further.
The dependency scanner checks your composer.lock file against the OSV.dev vulnerability database in real time. Unlike scanners with hardcoded advisory lists, Ward queries the live database covering the entire PHP/Composer ecosystem.
The dependency scanner performs a 2-phase lookup to minimize network requests:
1
Batch query for affected packages
Ward sends all packages from composer.lock to the OSV.dev batch API endpoint to identify which packages have known vulnerabilities.
// scanner.go:76-153func (s *Scanner) batchQuery(ctx context.Context, packages map[string]string) ([]vulnPackage, error) { // Build list of packages for name, version := range packages { q := query{Version: normalizeVersion(version)} q.Package.Name = name q.Package.Ecosystem = "Packagist" allQueries = append(allQueries, q) } // Send in batches of 100 for i := 0; i < len(allQueries); i += batchSize { // POST to https://api.osv.dev/v1/querybatch }}
2
Fetch full vulnerability details
For each affected package, Ward fetches complete vulnerability details including CVE IDs, severity, affected version ranges, and fixed versions.
// scanner.go:156-191func (s *Scanner) queryPackage(ctx context.Context, name, version string) ([]osvVuln, error) { body := map[string]any{ "package": map[string]string{ "name": name, "ecosystem": "Packagist", }, "version": version, } // POST to https://api.osv.dev/v1/query}
3
Convert to Ward findings
OSV vulnerabilities are mapped to Ward findings with severity, remediation commands, and references.
The scanner extracts the fixed version from OSV’s affected ranges:
// scanner.go:290-304func extractFixedVersion(affected []osvAffected, pkgName string) string { for _, a := range affected { if a.Package.Name != pkgName { continue } for _, r := range a.Ranges { for _, e := range r.Events { if e.Fixed != "" { return e.Fixed } } } } return ""}
# If a fixed version is specified in the findingcomposer require guzzlehttp/guzzle:^7.4.5# If no fixed version is available, update to latestcomposer update guzzlehttp/guzzle