Laravel Mass Assignment Flaw Lets Users Grant Themselves Admin via One Extra Form Field
A developer published a walkthrough showing how a single injected request field can make a user an administrator in a Laravel app. The vulnerability arises when a model disables Eloquent's mass-assignment protection with an empty guarded list and the controller passes all request input directly to an update call. Tests on a fresh Laravel 13.43 installation showed that adding an is_admin=1 parameter via curl succeeded, and CSRF protection does not stop it because the request comes from the user's own session. The author recommends declaring fillable fields explicitly with the #[Fillable] attribute and validating input before saving, noting that either change alone is weaker than using both. An allow-list approach is favored over a guarded-column list, since new columns remain protected by default.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in