GHSA-x7p5-p2c9-phvg: Laravel/framework Unexpected Database Bindings Vulnerability

HIGH
CVSS 7.2
CWE-74
Published
Advisory Summary

GHSA-x7p5-p2c9-phvg is a HIGH (CVSS 7.2) unexpected database bindings vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Laravel/framework libraries in the Packagist ecosystem. The issue involves unexpected database bindings. Remediation is available by upgrading affected packages to version 6.20.14, 7.30.4, 8.24.0.

GHSA-x7p5-p2c9-phvg at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-x7p5-p2c9-phvg
Severity HIGH
CVSS v3.1 Base Score 7.2
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product Laravel/framework
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-x7p5-p2c9-phvg

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: 6.20.14
Upgrade laravel/framework to 6.20.14
laravel/framework fixed: 7.30.4
Upgrade laravel/framework to 7.30.4
laravel/framework fixed: 8.24.0
Upgrade laravel/framework to 8.24.0
illuminate/database fixed: 6.20.14
Upgrade illuminate/database to 6.20.14
illuminate/database fixed: 7.30.4
Upgrade illuminate/database to 7.30.4
illuminate/database fixed: 8.24.0
Upgrade illuminate/database to 8.24.0
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-x7p5-p2c9-phvg, 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.20.14), 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-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. 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

This is a follow-up to the previous security advisory (GHSA-3p32-j457-pg5x) which addresses a few additional edge cases. If a request is crafted where a field that is normally a non-array value is an array, and that input is not validated or cast to its expected type before being passed to the query builder, an unexpected number of query bindings can be added to the query. In some situations, this will simply lead to no results being returned by the query builder; however, it is possible certain queries could be affected in a way that causes the query to return unexpected results.

GHSA-x7p5-p2c9-phvg Affected Laravel/framework Versions

6 component(s)
Fixed Versions:
6.20.147.30.48.24.0
Product / Package Ecosystem Affected Versions Fixed Version
laravel/framework
Packagist
< 6.20.14
6.20.14
laravel/framework
Packagist
≥ 7.0.0
< 7.30.4
7.30.4
laravel/framework
Packagist
≥ 8.0.0
< 8.24.0
8.24.0
illuminate/database
Packagist
< 6.20.14
6.20.14
illuminate/database
Packagist
≥ 7.0.0
< 7.30.4
7.30.4
illuminate/database
Packagist
≥ 8.0.0
< 8.24.0
8.24.0

References

Frequently Asked Questions

What is GHSA-x7p5-p2c9-phvg?
GHSA-x7p5-p2c9-phvg is a security vulnerability in Laravel/framework involving Unexpected database bindings under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which Laravel/framework versions are affected?
Affected versions include releases prior to 6.20.14, 7.30.4, 8.24.0 across affected packages: laravel/framework, illuminate/database.
What version fixes GHSA-x7p5-p2c9-phvg?
Upgrading to 6.20.14, 7.30.4, 8.24.0 (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 6.20.14, 7.30.4, 8.24.0. Upgrade your dependency to 6.20.14, 7.30.4, 8.24.0 or later.
Is illuminate/database affected?
Yes, illuminate/database is affected in releases prior to 6.20.14, 7.30.4, 8.24.0. Upgrade your dependency to 6.20.14, 7.30.4, 8.24.0 or later.
What is the CVSS score of GHSA-x7p5-p2c9-phvg?
GHSA-x7p5-p2c9-phvg has a CVSS v3.1 base score of 7.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N.
What CWE is associated with GHSA-x7p5-p2c9-phvg?
GHSA-x7p5-p2c9-phvg is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.).
How can I check Packagist dependencies for GHSA-x7p5-p2c9-phvg?
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-x7p5-p2c9-phvg",
  "modified" : "2021-02-02T15:46:07Z",
  "published" : "2021-02-02T15:47:08Z",
  "aliases" : [ ],
  "summary" : "Unexpected database bindings",
  "details" : "This is a follow-up to the previous security advisory (GHSA-3p32-j457-pg5x) which addresses a few additional edge cases.\n\nIf a request is crafted where a field that is normally a non-array value is an array, and that input is not validated or cast to its expected type before being passed to the query builder, an unexpected number of query bindings can be added to the query. In some situations, this will simply lead to no results being returned by the query builder; however, it is possible certain queries could be affected in a way that causes the query to return unexpected results.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "laravel/framework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.20.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "laravel/framework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.30.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "laravel/framework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.24.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "illuminate/database"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.20.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "illuminate/database"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.30.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "illuminate/database"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.24.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/laravel/framework/security/advisories/GHSA-x7p5-p2c9-phvg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-3p32-j457-pg5x"
  }, {
    "type" : "WEB",
    "url" : "https://packagist.org/packages/illuminate/database"
  }, {
    "type" : "WEB",
    "url" : "https://packagist.org/packages/laravel/framework"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-02-02T15:46:07Z",
    "nvd_published_at" : null
  }
}