GHSA-wq8p-mqvg-2p5h: Laravel/framework SQL Injection Vulnerability

HIGH
CWE-89
Published
Advisory Summary

GHSA-wq8p-mqvg-2p5h is a HIGH sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Laravel/framework libraries in the Packagist ecosystem. The issue involves laravel framework sql injection via limit and offset functions. Remediation is available by upgrading affected packages to version 6.20.26, 7.30.5, 8.40.0.

GHSA-wq8p-mqvg-2p5h at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-wq8p-mqvg-2p5h
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Laravel/framework
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix GHSA-wq8p-mqvg-2p5h

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.26
Upgrade laravel/framework to 6.20.26
laravel/framework fixed: 7.30.5
Upgrade laravel/framework to 7.30.5
laravel/framework fixed: 8.40.0
Upgrade laravel/framework to 8.40.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-wq8p-mqvg-2p5h, 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.26), 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-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. 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

### Impact Those using SQL Server with Laravel and allowing user input to be passed directly to the limit and offset functions are vulnerable to SQL injection. Other database drivers such as MySQL and Postgres are not affected by this vulnerability. ### Patches This problem has been patched on Laravel versions 6.20.26, 7.30.5, and 8.40.0. ### Workarounds You may workaround this vulnerability by ensuring that only integers are passed to the limit and offset functions, as well as the skip and take functions.

GHSA-wq8p-mqvg-2p5h Affected Laravel/framework Versions

3 component(s)
Fixed Versions:
6.20.267.30.58.40.0
Product / Package Ecosystem Affected Versions Fixed Version
laravel/framework
Packagist
≥ 6.0.0
< 6.20.26
6.20.26
laravel/framework
Packagist
≥ 7.0.0
< 7.30.5
7.30.5
laravel/framework
Packagist
≥ 8.0.0
< 8.40.0
8.40.0

References

Frequently Asked Questions

What is GHSA-wq8p-mqvg-2p5h?
GHSA-wq8p-mqvg-2p5h is a security vulnerability in Laravel/framework involving laravel framework SQL Injection via limit and offset functions under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Laravel/framework versions are affected?
Affected versions include releases prior to 6.20.26, 7.30.5, 8.40.0 across affected packages: laravel/framework.
What version fixes GHSA-wq8p-mqvg-2p5h?
Upgrading to 6.20.26, 7.30.5, 8.40.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.26, 7.30.5, 8.40.0. Upgrade your dependency to 6.20.26, 7.30.5, 8.40.0 or later.
What CWE is associated with GHSA-wq8p-mqvg-2p5h?
GHSA-wq8p-mqvg-2p5h is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check Packagist dependencies for GHSA-wq8p-mqvg-2p5h?
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-wq8p-mqvg-2p5h",
  "modified" : "2024-05-15T22:20:42Z",
  "published" : "2024-05-15T22:20:42Z",
  "aliases" : [ ],
  "summary" : "laravel framework SQL Injection via limit and offset functions",
  "details" : "### Impact\nThose using SQL Server with Laravel and allowing user input to be passed directly to the limit and offset functions are vulnerable to SQL injection. Other database drivers such as MySQL and Postgres are not affected by this vulnerability.\n\n### Patches\nThis problem has been patched on Laravel versions 6.20.26, 7.30.5, and 8.40.0.\n\n### Workarounds\nYou may workaround this vulnerability by ensuring that only integers are passed to the limit and offset functions, as well as the skip and take functions.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "laravel/framework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.20.26"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "laravel/framework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.30.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "laravel/framework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.40.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/laravel/framework/security/advisories/GHSA-4mg9-vhxq-vm7j"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/laravel/framework/2021-04-28.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/laravel/framework"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-15T22:20:42Z",
    "nvd_published_at" : null
  }
}