Laravel Guard bypass in Eloquent models
Published 15 May 2024 · Updated 29 Nov 2024
Is your project on an affected laravel/framework?
Affected packages
- Affected
- >=5.5.0 <=5.5.49
- Fixed in
- No fix released
- Affected
- >=6.0.0 <6.18.34
- Fixed in
- 6.18.34
composer require laravel/framework:^6.18.34- Affected
- >=7.0.0 <7.23.2
- Fixed in
- 7.23.2
composer require laravel/framework:^7.23.2Details
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.
Is GHSA-44pg-c29v-hp6r in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected laravel/framework, and gives you the command that fixes it.
More advisories for laravel/framework
- CriticalCVE-2026-114509Laravel TokenGuard authentication bypass through non-string API credentials · 23 Oct 2026
- MediumCVE-2026-114508Laravel relationship inclusion can trigger unauthorized data destruction · 23 Oct 2026
- LowCVE-2026-102279Laravel: XSS in Debug Page Information · 29 Sept 2026
- MediumGHSA-crmm-hgp2-wgrpLaravel Framework: Temporary Signed URL Path Confusion · 17 Jun 2026
- HighCVE-2026-48019Laravel Framework: CRLF injection in default email rule · 17 Jun 2026
- MediumCVE-2024-13918Laravel framework susceptible to reflected cross-site scripting · 10 Mar 2025
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.