CVE-2026-48808
Analyzed Analyzed - Analysis Complete

Twig Template Engine Sandbox Policy Bypass

Vulnerability report for CVE-2026-48808, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-14

Last updated on: 2026-07-17

Assigner: GitHub, Inc.

Description

Twig is a template language for PHP. Prior to 3.27.0, the column filter passes the active sandbox state as a boolean but does not forward the current Source to SandboxExtension::checkPropertyAllowed(), so SourcePolicyInterface decisions are lost and a template author can read public or magic properties not allowed by the sandbox policy. This issue is fixed in version 3.27.0.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-14
Last Modified
2026-07-17
Generated
2026-08-04
AI Q&A
2026-07-15
EPSS Evaluated
2026-08-02
NVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
symfony twig to 3.27.0 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-693 The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.
CWE-863 The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability affects Twig, a template language for PHP. In versions prior to 3.27.0, the 'column' filter in Twig incorrectly handles the sandbox state. Specifically, it passes the active sandbox state as a boolean but fails to forward the current 'Source' to the 'SandboxExtension::checkPropertyAllowed()' method.

As a result, any decisions made by 'SourcePolicyInterface' are lost. This flaw allows a template author to read public or magic properties that should be restricted by the sandbox policy, bypassing intended security controls.

Detection Guidance

Detecting this vulnerability requires checking if your system is using a vulnerable version of Twig (prior to 3.27.0). Since this is a code-level vulnerability, detection primarily involves inspecting the installed Twig version and reviewing template files for potential misuse of the column filter in a sandboxed environment.

  • Check the installed Twig version using Composer (PHP dependency manager). Run the following command in your project directory: composer show twig/twig | grep 'versions'.
  • If you are not using Composer, manually inspect the Twig library files for the version number, typically found in the VERSION file or in the main Twig class file.
  • Review template files for usage of the column filter, especially in sandboxed environments. Look for patterns like {{ object|column('property') }} where 'property' could be a restricted or magic property.

Network-based detection is not applicable for this vulnerability, as it is a code-level issue rather than a network-exploitable flaw.

Impact Analysis

If you are using an affected version of Twig (prior to 3.27.0) in your application, this vulnerability could have the following impacts:

  • Unauthorized access to sensitive data: A malicious or compromised template author could read properties that should be protected by the sandbox policy, potentially exposing sensitive information.
  • Security policy bypass: The sandbox restrictions designed to limit template authors' access to certain properties may be ineffective, leading to unintended data exposure or manipulation.
  • Increased risk in multi-user environments: If your application allows untrusted users to create or modify templates, this vulnerability could be exploited to access data they should not have permissions to view.
Compliance Impact

This vulnerability could impact compliance with several common standards and regulations, depending on the context of your application:

  • GDPR (General Data Protection Regulation): If the vulnerability leads to unauthorized access to personal data of EU citizens, it could result in a violation of GDPR. This may include failure to protect personal data (Article 5) or lack of appropriate security measures (Article 32).
  • HIPAA (Health Insurance Portability and Accountability Act): If your application processes protected health information (PHI) and this vulnerability allows unauthorized access to such data, it could violate HIPAA's Security Rule, which requires safeguards to protect PHI.
  • Other data protection regulations: Similar regulations, such as CCPA (California Consumer Privacy Act) or industry-specific standards, may also be impacted if the vulnerability leads to unauthorized data exposure.

To maintain compliance, it is important to update to the fixed version of Twig (3.27.0 or later) and review any templates or policies that rely on the sandbox restrictions.

Mitigation Strategies

To mitigate this vulnerability, follow these steps:

  • Upgrade Twig to version 3.27.0 or later, as this version contains the fix for the issue. Use Composer to update: composer require twig/twig:^3.27.0.
  • If upgrading is not immediately possible, review and restrict the use of the column filter in sandboxed templates. Ensure that only trusted template authors have access to sandboxed environments.
  • Audit your template files for any usage of the column filter, particularly in contexts where sandboxing is enabled. Remove or modify any instances that could expose restricted or magic properties.
  • Implement additional validation or policies to enforce restrictions on property access in sandboxed templates, even after upgrading.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-48808. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart