GHSA-44pg-c29v-hp6r Laravel Guard bypass in Eloquent models
Attackers can bypass mass assignment guards to modify protected database fields by using table-prefixed attribute names in Laravel applications.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is GHSA-44pg-c29v-hp6r?
GHSA-44pg-c29v-hp6r is a missing authorization vulnerability in laravel/framework, published on 15 May 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
In laravel releases before 6.18.34 and 7.23.2. It was possible to mass assign Eloquent attributes that included the model's table name:
$model->fill(['users.name' => 'Taylor']);
When doing so, Eloquent would remove the table name from the attribute for you. This was a "convenience" feature of Eloquent and was not documented.
However, when paired with validation, this can lead to unexpected and unvalidated values being saved to the database. For this reason, we have removed the automatic stripping of table names from mass-asignment operations so that the attributes go through the typical "fillable" / "guarded" logic. Any attributes containing table names that are not explicitly declared as fillable will be discarded.
This security release will be a breaking change for applications that were relying on the undocumented table name stripping during mass assignment. Since this feature was relatively unknown and undocumented, we expect the vast majority of Laravel applications to be able to upgrade without issues.
Which versions are affected by GHSA-44pg-c29v-hp6r?
6 open source packages ship an affected version, including laravel/framework.
| Package | Affected | Fixed in |
|---|---|---|
laravel/framework Packagist | From 5.5.0 to 5.5.49 | None |
laravel/framework Packagist | From 5.5.0 to 5.5.49 | None |
laravel/framework Packagist | From 6.0.0 | 6.18.34 |
laravel/framework Packagist | From 6.0.0 | 6.18.34 |
laravel/framework Packagist | From 7.0.0 | 7.23.2 |
laravel/framework Packagist | From 7.0.0 | 7.23.2 |
How do I fix GHSA-44pg-c29v-hp6r?
Upgrade laravel/framework to a fixed version for your release line: 6.18.34 or 7.23.2.
Upgrade, and check permissions on every request on the server, not only in the interface. More about Missing authorization.
Is GHSA-44pg-c29v-hp6r being exploited?
There is no known exploitation of GHSA-44pg-c29v-hp6r in the wild and no public exploit code.