VDB
Sign up
MEDIUM

GHSA-44pg-c29v-hp6r

Laravel Guard bypass in Eloquent models

Quick fix

GHSA-44pg-c29v-hp6r — laravel/framework: upgrade to the fixed version with the command below.

composer require laravel/framework:^6.18.34

Details

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.

Are you affected?

Enter the version of the package you're using.

Affected packages

Packagist/laravel/framework
Introduced in: 5.5.0

No fixed version published yet for laravel/framework (composer). Pin to a known-safe version or switch to an alternative.

Packagist/laravel/framework
Introduced in: 6.0.0Fixed in: 6.18.34
Fixcomposer require laravel/framework:^6.18.34
Packagist/laravel/framework
Introduced in: 7.0.0Fixed in: 7.23.2
Fixcomposer require laravel/framework:^7.23.2

References

Check it before you install it

One call answers whether to add this package: known advisories, CISA KEV, and whether the name is a hallucinated or freshly squatted one. No key needed to try it.

curl -s https://vdb.ai.kr/v1/ai/check-packages \
  -H 'Content-Type: application/json' \
  -d '{"packages":["pkg:composer/laravel/framework"]}'