symfony/cache
Symfony Cache provides fast, low-overhead PSR-6 caching with adapters for common backends. Includes PSR-16 bridge plus implementations of symfony/cache-contracts CacheInterface and TagAwareCacheInterface for flexible app caching.
clear(): The CVE-2026-45073 fix in AbstractAdapter::clear() introduces input validation for the prefix parameter, ensuring no arbitrary cache key deletion via malformed prefixes. This is a critical security hardening for Laravel’s Cache::flush() and Cache::clear() workflows.TagAwareAdapter fix (bug #63964) remains in place.ChainAdapter or other adapters.clear() prefix validation does not break existing Laravel usage (e.g., Cache::flush() or Cache::clear()). However, custom implementations passing raw user input to AbstractAdapter::clear() must validate prefixes.clear() calls.| Laravel Driver | Symfony Cache Impact | Notes |
|---|---|---|
file |
Prefix validation in clear() |
Safe; no user-controlled prefixes. |
redis |
Prefix validation in clear() |
Safe; Redis keys are prefixed. |
database |
Prefix validation in clear() |
Safe; DB keys are scoped. |
memcached |
Prefix validation in clear() |
Safe; Memcached keys are prefixed. |
| Custom Adapters | Critical if passing untrusted prefixes | Audit Cache::clear() usage. |
AbstractAdapter::clear(): Now rejects malformed prefixes (e.g., ../, ../../). Custom adapters extending AbstractAdapter must ensure prefixes are sanitized before calling clear().Cache facade: Cache::flush() and Cache::clear() are safe as they use Laravel’s internal prefixing.clear().clear().Cache facade usage is unaffected.Symfony\Component\Cache\AbstractAdapter and passing user-controlled input to clear()? If so, audit prefix sanitization.Cache::clear() Overrides:
Cache::clear() with custom logic? Test with the new prefix validation.Cache::clear() in CI to ensure no regressions?clear() prefix safety requirement?AbstractAdapter::clear() directly with raw input? These may need updates.clear() fix does not affect Laravel’s Cache facade but protects against malicious prefix injection.Psr16Cache or tag-aware caching.file, redis, database, etc.) are safe as they use internal prefixing.LockRegistry remains unaffected.ChainAdapter behavior is unchanged.| Step | Action | Risks | Mitigation |
|---|---|---|---|
| 1 | Audit Custom Adapters | Reject malformed prefixes. | Test all AbstractAdapter extensions. |
| 2 | Validate Cache::clear() |
Ensure no user input leaks to clear(). |
Mock clear() calls with edge-case prefixes. |
| 3 | Test Legacy Scripts | Scripts calling AbstractAdapter::clear() directly. |
Update to sanitize prefixes. |
| 4 | Update Documentation | Highlight clear() prefix safety. |
Add note to Laravel cache adapter guides. |
cache: prefix remains compatible.CacheDataCollector still works.clear(), but no breaking changes for Laravel’s Cache facade.clear().AbstractAdapter::clear().Cache::clear():
Cache facade remains unaffected.clear().clear() calls (e.g., in custom logic).clear().AbstractAdapter::clear() directly.AbstractAdapter::clear() now throws exceptions for invalid prefixes (e.g., ../). Mitigation: Sanitize input before calling clear().Cache Facade: No failure modes. Native usage is unaffected.clear() prefix safety requirement for custom adapters.clear() in CI pipelines.clear() prefix validation.AbstractAdapter::clear() directly for updates.How can I help you explore Laravel packages today?