GHSA-44pg-c29v-hp6r: Laravel/framework Laravel Guard Bypass Vulnerability

MODERATE
CWE-20
Published
Advisory Summary

GHSA-44pg-c29v-hp6r is a MODERATE laravel guard bypass vulnerability (CWE-20: Improper Input Validation) affecting Laravel/framework libraries in the Packagist ecosystem. The issue involves laravel guard bypass in eloquent models. Remediation is available by upgrading affected packages to version 6.18.34, 7.23.2.

GHSA-44pg-c29v-hp6r at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-44pg-c29v-hp6r
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-20: Improper Input Validation
Affected Product Laravel/framework
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix GHSA-44pg-c29v-hp6r

To remediate this vulnerability, upgrade all affected Laravel/framework dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

laravel/framework fixed: Latest secure release
Upgrade laravel/framework to Latest secure release
laravel/framework fixed: 6.18.34
Upgrade laravel/framework to 6.18.34
laravel/framework fixed: 7.23.2
Upgrade laravel/framework to 7.23.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for laravel/framework

How to Check if You Are Affected

To determine whether your application is affected by GHSA-44pg-c29v-hp6r, inspect your project dependencies for Laravel/framework:

inspect dependencies for laravel/framework

Analyze the terminal output to locate any version of Laravel/framework in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.18.34), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Laravel/framework, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

GHSA-44pg-c29v-hp6r Affected Laravel/framework Versions

3 component(s)
Fixed Versions:
6.18.347.23.2
Product / Package Ecosystem Affected Versions Fixed Version
laravel/framework
Packagist
≥ 5.5.0
≤ 5.5.49
laravel/framework
Packagist
≥ 6.0.0
< 6.18.34
6.18.34
laravel/framework
Packagist
≥ 7.0.0
< 7.23.2
7.23.2

References

Frequently Asked Questions

What is GHSA-44pg-c29v-hp6r?
GHSA-44pg-c29v-hp6r is a security vulnerability in Laravel/framework involving Laravel Guard bypass in Eloquent models under CWE-20: Improper Input Validation.
Which Laravel/framework versions are affected?
Affected versions include releases prior to 6.18.34, 7.23.2 across affected packages: laravel/framework.
What version fixes GHSA-44pg-c29v-hp6r?
Upgrading to 6.18.34, 7.23.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is laravel/framework affected?
Yes, laravel/framework is affected in releases prior to Latest secure release, 6.18.34, 7.23.2. Upgrade your dependency to Latest secure release, 6.18.34, 7.23.2 or later.
What CWE is associated with GHSA-44pg-c29v-hp6r?
GHSA-44pg-c29v-hp6r is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Packagist dependencies for GHSA-44pg-c29v-hp6r?
Run the dependency tree command: 'inspect dependencies for laravel/framework'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-44pg-c29v-hp6r",
  "modified" : "2024-05-15T22:18:33Z",
  "published" : "2024-05-15T22:18:33Z",
  "aliases" : [ ],
  "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:\n```\n$model->fill(['users.name' => 'Taylor']);\n```\nWhen doing so, Eloquent would remove the table name from the attribute for you. This was a \"convenience\" feature of Eloquent and was not documented.\n\nHowever, 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.\n\nThis 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" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "laravel/framework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.5.0"
      }, {
        "last_affected" : "5.5.49"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "laravel/framework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.18.34"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "laravel/framework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.23.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://blog.laravel.com/security-release-laravel-61834-7232"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/laravel/framework/2020-08-06-1.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/laravel/framework"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-15T22:18:33Z",
    "nvd_published_at" : null
  }
}