spatie/laravel-permission is vulnerable to Race Condition
30
Low Risk
Affected versions of this package are vulnerable to a race condition in the loadPermissions() method of the PermissionRegistrar class. The vulnerability occurs due to a Time-of-Check to Time-of-Use (TOCTOU) flaw, where multiple concurrent requests can simultaneously pass the if ($this->permissions) check before permissions are loaded. This can result in cache stampedes, redundant database queries, performance degradation, excessive memory usage, and database overload in concurrent environments such as Laravel Octane, Swoole, or RoadRunner.
You are affected if you are using a version that falls within the vulnerable range.
spatie/laravel-permission is vulnerable to Race Condition in versions 0.0.1 - 6.21.0.
Upgrade the spatie/laravel-permission library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

SOC 2Compliant
ISO 27001Compliant