Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. laravel/framework
  4. ›
  5. GHSA-44pg-c29v-hp6r

GHSA-44pg-c29v-hp6r: Laravel Guard bypass in Eloquent models

May 15, 2024

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.

References

  • blog.laravel.com/security-release-laravel-61834-7232
  • github.com/FriendsOfPHP/security-advisories/blob/master/laravel/framework/2020-08-06-1.yaml
  • github.com/advisories/GHSA-44pg-c29v-hp6r
  • github.com/laravel/framework

Code Behaviors & Features

Detect and mitigate GHSA-44pg-c29v-hp6r with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 5.5.0 up to 5.5.49, all versions starting from 6.0.0 before 6.18.34, all versions starting from 7.0.0 before 7.23.2

Fixed versions

  • 6.18.34
  • 7.23.2

Solution

Upgrade to versions 6.18.34, 7.23.2 or above.

Weakness

  • CWE-20: Improper Input Validation

Source file

packagist/laravel/framework/GHSA-44pg-c29v-hp6r.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:38 +0000.