CVE-2024-22406: Shopware/core SQL Injection Vulnerability

CRITICAL
Advisory Identifier: GHSA-qmp9-2xwj-m6m9
CVSS 9.3
CWE-89
Published
Advisory Summary

CVE-2024-22406 is a CRITICAL (CVSS 9.3) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Shopware/core libraries in the Packagist ecosystem. The issue involves blind sql injection in shopware. Remediation is available by upgrading affected packages to version 6.5.7.4.

CVE-2024-22406 at a Glance

CVE Identifier CVE-2024-22406
GHSA Identifier GHSA-qmp9-2xwj-m6m9
Severity CRITICAL
CVSS v3.1 Base Score 9.3
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Shopware/core
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 9.3

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:H/I:N/A:L).

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 High (C:H)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2024-22406

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

shopware/core fixed: 6.5.7.4
Upgrade shopware/core to 6.5.7.4
shopware/platform fixed: 6.5.7.4
Upgrade shopware/platform to 6.5.7.4
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 shopware/core

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-22406, inspect your project dependencies for Shopware/core:

inspect dependencies for shopware/core

Analyze the terminal output to locate any version of Shopware/core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.5.7.4), 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 Shopware/core, 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 The Shopware application API contains a search functionality which enables users to search through information stored within their Shopware instance. The searches performed by this function can be aggregated using the parameters in the “aggregations” object. The ‘name’ field in this “aggregations” object is vulnerable SQL-injection and can be exploited using time-based SQL-queries. ### Patches Update to Shopware 6.5.7.4 ### Workarounds For older versions of 6.1, 6.2, 6.3 and 6.4 corresponding security measures are also available via a plugin. For the full range of functions, we recommend updating to the latest Shopware version.

CVE-2024-22406 Affected Shopware/core Versions

2 component(s)
Fixed Versions:
6.5.7.4
Product / Package Ecosystem Affected Versions Fixed Version
shopware/core
Packagist
< 6.5.7.4
6.5.7.4
shopware/platform
Packagist
< 6.5.7.4
6.5.7.4

References

Frequently Asked Questions

What is CVE-2024-22406?
CVE-2024-22406 is a security vulnerability in Shopware/core involving Blind SQL injection in shopware under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Shopware/core versions are affected?
Affected versions include releases prior to 6.5.7.4 across affected packages: shopware/core, shopware/platform.
What version fixes CVE-2024-22406?
Upgrading to 6.5.7.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is shopware/core affected?
Yes, shopware/core is affected in releases prior to 6.5.7.4. Upgrade your dependency to 6.5.7.4 or later.
Is shopware/platform affected?
Yes, shopware/platform is affected in releases prior to 6.5.7.4. Upgrade your dependency to 6.5.7.4 or later.
What is the CVSS score of CVE-2024-22406?
CVE-2024-22406 has a CVSS v3.1 base score of 9.3 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L.
What CWE is associated with CVE-2024-22406?
CVE-2024-22406 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 CVE-2024-22406?
Run the dependency tree command: 'inspect dependencies for shopware/core'. 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-qmp9-2xwj-m6m9",
  "modified" : "2024-01-17T20:28:50Z",
  "published" : "2024-01-17T20:28:50Z",
  "aliases" : [ "CVE-2024-22406" ],
  "summary" : "Blind SQL injection in shopware",
  "details" : "### Impact\nThe Shopware application API contains a search functionality which enables users to search through information stored within their Shopware instance. The searches performed by this function can be aggregated using the parameters in the “aggregations”\nobject. The ‘name’ field in this “aggregations” object is vulnerable SQL-injection and can be exploited using time-based SQL-queries. \n\n### Patches\nUpdate to Shopware 6.5.7.4\n\n### Workarounds\nFor older versions of 6.1, 6.2, 6.3 and 6.4 corresponding security measures are also available via a plugin. For the full range of functions, we recommend updating to the latest Shopware version.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "shopware/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.5.7.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.5.7.3"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "shopware/platform"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.5.7.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.5.7.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/shopware/shopware/security/advisories/GHSA-qmp9-2xwj-m6m9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-22406"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/shopware/core/commit/e2256ec81e56f792623e90d89786d8a9fcad28bf"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/shopware/shopware/commit/5005213e609f5a4423fcfa92f105c3de8ab35100"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/shopware/shopware"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/shopware/shopware/releases/tag/v6.5.7.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-01-17T20:28:50Z",
    "nvd_published_at" : "2024-01-16T23:15:08Z"
  }
}