Skip to content
Heist/ feed
Back to feed
Medium

php-twig — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2026-46628

Twig is a template language for PHP. Prior to 3.26.0, the deprecated spaceless filter is registered as safe for HTML, causing Twig autoescaping to emit attacker-controlled markup unescaped when spaceless is applied to untrusted input. This issue is fixed in version 3.26.0.

Products
php-twig
Affected versions
2.11.3-2, 2.12.1-1, 2.12.2-1, 2.12.3-1, 2.12.5-1, 2.12.5-1ubuntu0.1~esm1, 2.12.5-1ubuntu0.1~esm2, 3.20.0-2ubuntu1, 3.23.0-2build5, 3.23.0-2build7, 3.23.0-2ubuntu0.1~esm1, 3.27.1-1, 3.28.0-1, 3.3.2-1ubuntu3, 3.3.4-1, 3.3.6-1, 3.3.7-1, 3.3.8-2ubuntu4, 3.3.8-2ubuntu4+esm1, 3.3.8-2ubuntu4+esm2, 3.7.0-1, 3.7.1-1, 3.8.0-2, 3.8.0-2ubuntu0.1~esm1, 3.8.0-2ubuntu1, 3.8.0-2ubuntu1+esm1
Fixed versions
Not specified
CVEs
CVE-2026-46628
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 02:17 UTC · Revision 1

Source evidence

UBUNTU-CVE-2026-46628

core-osv · Original source

Published 14 Jul 2026, 22:16 UTC

Twig is a template language for PHP. Prior to 3.26.0, the deprecated spaceless filter is registered as safe for HTML, causing Twig autoescaping to emit attacker-controlled markup unescaped when spaceless is applied to untrusted input. This issue is fixed in version 3.26.0.

osv:UBUNTU-CVE-2026-46628

php-twig

Fixed versions: Not specified

php-twig

Fixed versions: Not specified

php-twig

Fixed versions: Not specified

php-twig

Fixed versions: Not specified

php-twig

Fixed versions: Not specified

php-twig

Fixed versions: Not specified

Complete source record
{
  "id": "3a58080829a1d9beaeb8ab56d4ae50a9705be0c2bfd7bbb15c6115715cec50d1",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-46628",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2026-46628",
    "summary": "Twig is a template language for PHP. Prior to 3.26.0, the deprecated spaceless filter is registered as safe for HTML, causing Twig autoescaping to emit attacker-controlled markup unescaped when spaceless is applied to untrusted input. This issue is fixed in version 3.26.0.",
    "evidence": "osv:UBUNTU-CVE-2026-46628",
    "products": [
      {
        "name": {
          "value": "php-twig",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.11.3-2",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "2.12.1-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "2.12.2-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "2.12.3-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "2.12.5-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "2.12.5-1ubuntu0.1~esm1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "2.12.5-1ubuntu0.1~esm2",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "php-twig",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.3.2-1ubuntu3",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3.3.4-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3.3.6-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3.3.7-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3.3.8-2ubuntu4",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3.3.8-2ubuntu4+esm1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3.3.8-2ubuntu4+esm2",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "php-twig",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.7.0-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "3.7.1-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "3.8.0-2",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "3.8.0-2ubuntu0.1~esm1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "3.8.0-2ubuntu1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "3.8.0-2ubuntu1+esm1",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "php-twig",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.20.0-2ubuntu1",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "php-twig",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.23.0-2build7",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "3.27.1-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "3.28.0-1",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "php-twig",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.20.0-2ubuntu1",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "3.23.0-2build5",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "3.23.0-2build7",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "3.23.0-2ubuntu0.1~esm1",
            "evidence": "/affected/5/versions"
          }
        ]
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "UBUNTU-CVE-2026-46628",
      "aliases": [
        "UBUNTU-CVE-2026-46628"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
        },
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "php-twig",
            "purl": "pkg:deb/ubuntu/php-twig?arch=source&distro=esm-apps%2Ffocal",
            "ecosystem": "Ubuntu:Pro:20.04:LTS"
          },
          "versions": [
            "2.11.3-2",
            "2.12.1-1",
            "2.12.2-1",
            "2.12.3-1",
            "2.12.5-1",
            "2.12.5-1ubuntu0.1~esm1",
            "2.12.5-1ubuntu0.1~esm2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46628.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "php-twig",
                "binary_version": "2.12.5-1ubuntu0.1~esm2"
              },
              {
                "binary_name": "php-twig-cssinliner-extra",
                "binary_version": "2.12.5-1ubuntu0.1~esm2"
              },
              {
                "binary_name": "php-twig-extra-bundle",
                "binary_version": "2.12.5-1ubuntu0.1~esm2"
              },
              {
                "binary_name": "php-twig-html-extra",
                "binary_version": "2.12.5-1ubuntu0.1~esm2"
              },
              {
                "binary_name": "php-twig-inky-extra",
                "binary_version": "2.12.5-1ubuntu0.1~esm2"
              },
              {
                "binary_name": "php-twig-intl-extra",
                "binary_version": "2.12.5-1ubuntu0.1~esm2"
              },
              {
                "binary_name": "php-twig-markdown-extra",
                "binary_version": "2.12.5-1ubuntu0.1~esm2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "php-twig",
            "purl": "pkg:deb/ubuntu/php-twig?arch=source&distro=esm-apps%2Fjammy",
            "ecosystem": "Ubuntu:Pro:22.04:LTS"
          },
          "versions": [
            "3.3.2-1ubuntu3",
            "3.3.4-1",
            "3.3.6-1",
            "3.3.7-1",
            "3.3.8-2ubuntu4",
            "3.3.8-2ubuntu4+esm1",
            "3.3.8-2ubuntu4+esm2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46628.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "php-twig",
                "binary_version": "3.3.8-2ubuntu4+esm2"
              },
              {
                "binary_name": "php-twig-cache-extra",
                "binary_version": "3.3.8-2ubuntu4+esm2"
              },
              {
                "binary_name": "php-twig-cssinliner-extra",
                "binary_version": "3.3.8-2ubuntu4+esm2"
              },
              {
                "binary_name": "php-twig-extra-bundle",
                "binary_version": "3.3.8-2ubuntu4+esm2"
              },
              {
                "binary_name": "php-twig-html-extra",
                "binary_version": "3.3.8-2ubuntu4+esm2"
              },
              {
                "binary_name": "php-twig-inky-extra",
                "binary_version": "3.3.8-2ubuntu4+esm2"
              },
              {
                "binary_name": "php-twig-intl-extra",
                "binary_version": "3.3.8-2ubuntu4+esm2"
              },
              {
                "binary_name": "php-twig-markdown-extra",
                "binary_version": "3.3.8-2ubuntu4+esm2"
              },
              {
                "binary_name": "php-twig-string-extra",
                "binary_version": "3.3.8-2ubuntu4+esm2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "php-twig",
            "purl": "pkg:deb/ubuntu/php-twig?arch=source&distro=esm-apps%2Fnoble",
            "ecosystem": "Ubuntu:Pro:24.04:LTS"
          },
          "versions": [
            "3.7.0-1",
            "3.7.1-1",
            "3.8.0-2",
            "3.8.0-2ubuntu0.1~esm1",
            "3.8.0-2ubuntu1",
            "3.8.0-2ubuntu1+esm1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46628.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "php-twig",
                "binary_version": "3.8.0-2ubuntu1+esm1"
              },
              {
                "binary_name": "php-twig-cache-extra",
                "binary_version": "3.8.0-2ubuntu1+esm1"
              },
              {
                "binary_name": "php-twig-cssinliner-extra",
                "binary_version": "3.8.0-2ubuntu1+esm1"
              },
              {
                "binary_name": "php-twig-extra-bundle",
                "binary_version": "3.8.0-2ubuntu1+esm1"
              },
              {
                "binary_name": "php-twig-html-extra",
                "binary_version": "3.8.0-2ubuntu1+esm1"
              },
              {
                "binary_name": "php-twig-inky-extra",
                "binary_version": "3.8.0-2ubuntu1+esm1"
              },
              {
                "binary_name": "php-twig-intl-extra",
                "binary_version": "3.8.0-2ubuntu1+esm1"
              },
              {
                "binary_name": "php-twig-markdown-extra",
                "binary_version": "3.8.0-2ubuntu1+esm1"
              },
              {
                "binary_name": "php-twig-string-extra",
                "binary_version": "3.8.0-2ubuntu1+esm1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "php-twig",
            "purl": "pkg:deb/ubuntu/php-twig?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "3.20.0-2ubuntu1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46628.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "php-twig",
                "binary_version": "3.20.0-2ubuntu1"
              },
              {
                "binary_name": "php-twig-cache-extra",
                "binary_version": "3.20.0-2ubuntu1"
              },
              {
                "binary_name": "php-twig-cssinliner-extra",
                "binary_version": "3.20.0-2ubuntu1"
              },
              {
                "binary_name": "php-twig-extra-bundle",
                "binary_version": "3.20.0-2ubuntu1"
              },
              {
                "binary_name": "php-twig-html-extra",
                "binary_version": "3.20.0-2ubuntu1"
              },
              {
                "binary_name": "php-twig-inky-extra",
                "binary_version": "3.20.0-2ubuntu1"
              },
              {
                "binary_name": "php-twig-intl-extra",
                "binary_version": "3.20.0-2ubuntu1"
              },
              {
                "binary_name": "php-twig-markdown-extra",
                "binary_version": "3.20.0-2ubuntu1"
              },
              {
                "binary_name": "php-twig-string-extra",
                "binary_version": "3.20.0-2ubuntu1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "php-twig",
            "purl": "pkg:deb/ubuntu/php-twig?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "3.23.0-2build7",
            "3.27.1-1",
            "3.28.0-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46628.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "php-twig",
                "binary_version": "3.28.0-1"
              },
              {
                "binary_name": "php-twig-cache-extra",
                "binary_version": "3.28.0-1"
              },
              {
                "binary_name": "php-twig-cssinliner-extra",
                "binary_version": "3.28.0-1"
              },
              {
                "binary_name": "php-twig-extra-bundle",
                "binary_version": "3.28.0-1"
              },
              {
                "binary_name": "php-twig-html-extra",
                "binary_version": "3.28.0-1"
              },
              {
                "binary_name": "php-twig-inky-extra",
                "binary_version": "3.28.0-1"
              },
              {
                "binary_name": "php-twig-intl-extra",
                "binary_version": "3.28.0-1"
              },
              {
                "binary_name": "php-twig-markdown-extra",
                "binary_version": "3.28.0-1"
              },
              {
                "binary_name": "php-twig-string-extra",
                "binary_version": "3.28.0-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "php-twig",
            "purl": "pkg:deb/ubuntu/php-twig?arch=source&distro=esm-apps%2Fresolute",
            "ecosystem": "Ubuntu:Pro:26.04:LTS"
          },
          "versions": [
            "3.20.0-2ubuntu1",
            "3.23.0-2build5",
            "3.23.0-2build7",
            "3.23.0-2ubuntu0.1~esm1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46628.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "php-twig",
                "binary_version": "3.23.0-2ubuntu0.1~esm1"
              },
              {
                "binary_name": "php-twig-cache-extra",
                "binary_version": "3.23.0-2ubuntu0.1~esm1"
              },
              {
                "binary_name": "php-twig-cssinliner-extra",
                "binary_version": "3.23.0-2ubuntu0.1~esm1"
              },
              {
                "binary_name": "php-twig-extra-bundle",
                "binary_version": "3.23.0-2ubuntu0.1~esm1"
              },
              {
                "binary_name": "php-twig-html-extra",
                "binary_version": "3.23.0-2ubuntu0.1~esm1"
              },
              {
                "binary_name": "php-twig-inky-extra",
                "binary_version": "3.23.0-2ubuntu0.1~esm1"
              },
              {
                "binary_name": "php-twig-intl-extra",
                "binary_version": "3.23.0-2ubuntu0.1~esm1"
              },
              {
                "binary_name": "php-twig-markdown-extra",
                "binary_version": "3.23.0-2ubuntu0.1~esm1"
              },
              {
                "binary_name": "php-twig-string-extra",
                "binary_version": "3.23.0-2ubuntu0.1~esm1"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:58:25.058559876Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-46628"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2026-46628",
        "https://www.cve.org/CVERecord?id=CVE-2026-46628",
        "https://symfony.com/blog/cve-2026-46628-the-spaceless-filter-implicitly-marks-its-output-as-safe"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-46628",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/1/score"
  },
  "source_id": "core-osv",
  "document_id": 358662,
  "published_at": "2026-07-14T22:16:00+00:00"
}