Advisory

GHSA-44pg-c29v-hp6r

Also known as: None

Summary

Laravel Guard bypass in Eloquent models

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2024-05-15 22:18 UTC
Modified
2024-11-29 05:40 UTC

Affected packages and fixes

laravel/framework

Packagist · All systems

Affected

  • introduced 5.5.0, last affected 5.5.49 (ecosystem)

Fixed versions

None listed

Fix

No fixed version is listed.

laravel/framework

Packagist · All systems

Affected

  • introduced 6.0.0, fixed 6.18.34 (ecosystem)

Fixed versions

6.18.34

Fix

The export has no generic command for this ecosystem.

laravel/framework

Packagist · All systems

Affected

  • introduced 7.0.0, fixed 7.23.2 (ecosystem)

Fixed versions

7.23.2

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences