# GHSA-P2X6-PPF3-32R3: Sandbox property allow-list bypass via the join filter on non-iterable objects

- Database: GitHub
- Severity: CVSS 5.3 (Medium)
- Published: 2026-11-24
- Modified: 2026-11-24

## Tracked as

- [CVE-2026-133768](https://cve.now/CVE-2026-133768.md): twig/twig sandbox bypass exposes private properties in join filter

## Affected versions

- twig/twig (Packagist): fixed in 3.31.1

## Description

### Description

The `join` filter converted a value that isn't iterable with `(array) $value`. For an object, that gives every property, including the private and protected ones. A sandboxed template allowed to use `join` could therefore print properties that the policy denies, and that templates can't read otherwise:

```twig
{{ user|join(',') }}
```

### Resolution

A value that isn't iterable is now joined as a single item. A `Stringable` object prints its checked string, and other objects throw, as with the `first` and `last` filters.

The patch for this issue is available [here](https://github.com/twigphp/Twig/commit/6bcede134671133a4a056199af5cf4749d189d72) for branch 3.x.

### Credits

We would like to thank Fabien Potencier for reporting the issue and providing the fix.

## References

- https://github.com/twigphp/Twig/security/advisories/GHSA-p2x6-ppf3-32r3

Page: https://cve.now/GHSA-P2X6-PPF3-32R3

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
