Security fixes often exist, but your project cannot install them because of strict Composer
constraints. Examples include exact version pins (e.g., ==2.4.3), narrow ranges,
PHP platform locks (e.g., "platform": {"php": "7.4.33"}), or conflicts defined by other
packages. When constraints block upgrades, known vulnerabilities remain in production.
Flagging these blocking rules makes the risk visible and actionable. Once identified, teams can widen constraints, bump the PHP platform, or resolve conflicting packages so that patched versions can be installed quickly and safely.
# 1) List outdated packages (direct deps only)
composer outdated --direct
# 2) See why a target fixed version cannot be installed
composer why-not vendor/extension 2.4.5
# 3) Inspect constraint details and conflicts
composer why vendor/extension
composer show vendor/extension -a
# 4) Check for platform locks that block upgrades
cat composer.json | jq .config.platform
# or
composer config --list | grep platform
# 5) Validate composer configuration for red flags
composer validate --no-check-all
# Bad (blocks patches)
"vendor/extension": "2.4.3"
# Good (allows >=2.4.5 within same major)
"vendor/extension": "^2.4.5"
# composer.json
"config": {
"platform": { "php": "8.2.999" } # set to actual runtime or remove lock entirely
}
Ensure the server actually runs the specified PHP version.
conflict/replace that block the target version unless strictly needed.repositories that pin old releases.# Safely update a vulnerable package and its deps
composer update vendor/extension --with-all-dependencies
# composer.json
"require": {
"vendor/extension": "2.4.3" # exact pin
},
"config": {
"platform": { "php": "7.4.33" } # old PHP lock
}
$ composer why-not vendor/extension 2.4.5
- Root composer.json requires vendor/extension (2.4.3) -> no matching package found (2.4.5 blocked)
# Result: cannot install patched 2.4.5 → FAIL
# composer.json (after fix)
"require": {
"vendor/extension": "^2.4.5"
},
"config": {
"platform": { "php": "8.2.999" }
}
$ composer update vendor/extension --with-all-dependencies
# Installs 2.4.5+ and resolves CVE → PASS