Skip to content
Heist/ feed
Back to feed
Critical

Improper Control of Generation of Code in Twig rendered views in shopware

Type: advisorySources: OSV

Shopware is an open source commerce platform based on Symfony Framework and Vue js. In a Twig environment **without the Sandbox extension**, it is possible to refer to PHP functions in twig filters like `map`, `filter`, `sort`. This allows a template to call any global PHP function and thus execute arbitrary code. The attacker must have access to a Twig environment in order to exploit this vulnerability. This problem has been fixed with 6.4.18.1 with an override of the specified filters until the integration of the Sandbox extension has been finished. Users are advised to upgrade. Users of major versions 6.1, 6.2, and 6.3 may also receive this fix via a plugin.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2023-22731
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 10:52 UTC · Revision 1

Source evidence

Improper Control of Generation of Code in Twig rendered views in shopware

core-osv · Original source

Published 17 Jan 2023, 21:31 UTC

Shopware is an open source commerce platform based on Symfony Framework and Vue js. In a Twig environment **without the Sandbox extension**, it is possible to refer to PHP functions in twig filters like `map`, `filter`, `sort`. This allows a template to call any global PHP function and thus execute arbitrary code. The attacker must have access to a Twig environment in order to exploit this vulnerability. This problem has been fixed with 6.4.18.1 with an override of the specified filters until the integration of the Sandbox extension has been finished. Users are advised to upgrade. Users of major versions 6.1, 6.2, and 6.3 may also receive this fix via a plugin.

osv:CVE-2023-22731
Complete source record
{
  "id": "06b417a8e740711b3ae9fe3653127143234d2372513bafa86287b2f70514098b",
  "url": "https://osv.dev/vulnerability/CVE-2023-22731",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Improper Control of Generation of Code in Twig rendered views in shopware",
    "summary": "Shopware is an open source commerce platform based on Symfony Framework and Vue js. In a Twig environment **without the Sandbox extension**, it is possible to refer to PHP functions in twig filters like `map`, `filter`, `sort`. This allows a template to call any global PHP function and thus execute arbitrary code. The attacker must have access to a Twig environment in order to exploit this vulnerability. This problem has been fixed with 6.4.18.1 with an override of the specified filters until the integration of the Sandbox extension has been finished. Users are advised to upgrade. Users of major versions 6.1, 6.2, and 6.3 may also receive this fix via a plugin.",
    "evidence": "osv:CVE-2023-22731",
    "products": [],
    "severity": "critical",
    "structured": {
      "id": "CVE-2023-22731",
      "aliases": [
        "CVE-2023-22731",
        "GHSA-93cw-f5jj-x85w"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/shopware/shopware",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "166382c93c904445d4acbbfadaa39e7957e2d6a4"
                },
                {
                  "fixed": "89d1ea154689cb6202e0d3a0ceeae0febb0c09e1"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:shopware:shopware:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "6.4.18.1"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "89d1ea154689cb6202e0d3a0ceeae0febb0c09e1"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v6.4.18.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-22731.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:28.234162256Z",
      "provider": "osv",
      "references": [
        "https://docs.shopware.com/en/shopware-6-en/security-updates/security-update-01-2023?category=security-updates",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/22xxx/CVE-2023-22731.json",
        "https://github.com/shopware/platform/security/advisories/GHSA-93cw-f5jj-x85w",
        "https://nvd.nist.gov/vuln/detail/CVE-2023-22731",
        "https://github.com/shopware/platform/commit/89d1ea154689cb6202e0d3a0ceeae0febb0c09e1"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-94"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/22xxx/CVE-2023-22731.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2023-22731",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 494661,
  "published_at": "2023-01-17T21:31:45.875+00:00"
}