Laravel: Eloquent mass-assignment guard bypass via attribute-name normalization mismatch
Package
Affected versions
>= 13.0.0, < 13.43.0
< 12.73.0
Patched versions
13.43.0
12.73.0
Description
Published by the National Vulnerability Database
Dec 2, 2026
Published to the GitHub Advisory Database
Dec 3, 2026
Reviewed
Dec 3, 2026
Last updated
Dec 3, 2026
Impact
Eloquent's
$guardedprotection can be bypassed with an alternate spelling of a guarded attribute name, such as a hyphen or whitespace variant ofis_admin. The guard check compared the raw key, while set-mutator resolution normalized it withStr::studly()orStr::camel(). Applications are affected when a model uses a$guardedblacklist, defines a set-mutator (classic orAttribute-based) on a guarded attribute, and mass-assigns untrusted input such as$request->all(). A remote client could then write protected attributes such as role or privilege flags.Patches
A fix has been merged to the 12.x branch in laravel/framework#62499. It normalizes keys before comparing them against the guarded list.
References