CVE-2026-48808: Twig sandbox bypass in column filter via SourcePolicyInterface

CVE-2026-48808 · Severity: medium · CVSS 0 · Published 2026-07-14

Twig is a popular template engine for PHP used to generate dynamic web content. A security flaw in the 'column' filter allows template authors to bypass sandbox restrictions and access sensitive object properties that should be protected. This could lead to the unauthorized exposure of internal data or configuration details if an application allows users to provide their own templates.

Technologies: twig/twig (Packagist). Vendors: Packagist.

Quick answers

Is CVE-2026-48808 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-48808 being exploited in the wild.
How severe is CVE-2026-48808?
Medium severity, with a CVSS score of 0, published 14 July 2026.
Which products and versions are affected?
twig/twig (Packagist) <= 3.26.0, ECOSYSTEM:introduced=0,fixed=3.27.0.
Is there a fix for CVE-2026-48808?
Yes. twig/twig (Packagist): upgrade to 3.27.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-48808 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-48808?
Check whether you run twig/twig (Packagist) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • twig/twig (Packagist): upgrade to 3.27.0 or later
    composer require twig/twig:^3.27.0

Technical details

A vulnerability exists in Twig's CoreExtension::column() filter where the active sandbox state is passed as a boolean but the current Source context is not forwarded to SandboxExtension::checkPropertyAllowed(). When sandboxing is managed via SourcePolicyInterface, the missing Source context causes the security check to default to a non-sandboxed state, bypassing the property allowlist. This allows an attacker with template authorship privileges to access any public or magic property of objects within the render context. The issue is specific to SourcePolicyInterface-driven sandboxing and does not affect global sandbox mode. A fix is available in version 3.27.0.

Affected products

  • twigphp Twig < 3.27.0

Identifiers

  • CVE-2026-48808
  • GHSA-h8vq-8gpg-mhcg

Timeline

  • 2026-05-27: patched: Version 3.27.0 released
  • 2026-05-27: advisory: GitHub Security Advisory published
  • 2026-07-14: disclosed: CVE published to NVD

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.