twig/twig vulnerabilities
Twig, the flexible, fast, and secure template language for PHP
- Registry
- Composer
- Latest
- 3.30.0
- License
- BSD-3-Clause
24 known advisories
The latest version, 3.30.0, is not affected by any of them. Projects on older versions may be.
composer require twig/twig:^3.30.0Is your project on an affected twig/twig?
Look after several Laravel or PHP apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Security advisories for twig/twig
Twig: Sandbox filter, tag and function allow-list bypass when sandbox state changes between renders for a cached `Template`
- Affected
- <3.27.0
- Fixed in
- 3.27.0
Twig: Sandbox property allowlist bypass via the `column` filter under `SourcePolicyInterface`
- Affected
- <3.27.0
- Fixed in
- 3.27.0
Twig: Sandbox `__toString()` policy bypass via `Traversable` in `join` and `replace` filters
- Affected
- <3.27.0
- Fixed in
- 3.27.0
Twig: Sandbox `__toString()` policy bypass via dynamic mapping keys
- Affected
- <3.27.0
- Fixed in
- 3.27.0
Twig: Sandbox state regression in deprecated internal wrappers in `src/Resources/core.php`
- Affected
- <3.27.0
- Fixed in
- 3.27.0
Twig: Sandbox: multiple `__toString()` policy bypasses via unguarded string coercion points
- Affected
- <3.26.0
- Fixed in
- 3.26.0
Twig: XSS in profiler HtmlDumper via unescaped template and profile names
- Affected
- >=3.0.0 <3.26.0
- Fixed in
- 3.26.0
Twig: Possible sandbox bypass when using a source policy
- Affected
- >=2.16.0 <=2.16.1 · >=3.9.0 <3.26.0
- Fixed in
- 3.26.0
Twig: Arbitrary PHP code execution via `_self.(<string>)` macro-reference compilation
- Affected
- >=3.15.0 <3.26.0
- Fixed in
- 3.26.0
Twig: Sandbox property and method bypass via object-destructuring assignment
- Affected
- >=3.24.0 <3.26.0
- Fixed in
- 3.26.0
Twig: `{% sandbox %}{% include %}` skips checkSecurity() on cached templates (incomplete fix for CVE-2024-45411)
- Affected
- <3.26.0
- Fixed in
- 3.26.0
Twig: Sandbox property allowlist bypass via the `column` filter (array_column on objects)
- Affected
- <3.26.0
- Fixed in
- 3.26.0
Twig: `template_from_string()` escapes a SourcePolicy-driven sandbox via synthesized template name
- Affected
- >=3.9.0 <3.26.0
- Fixed in
- 3.26.0
Twig: PHP code injection via `{% use %}` template name
- Affected
- >=1.15.1 <3.26.0
- Fixed in
- 3.26.0
Twig: The `spaceless` filter implicitly marks its output as safe
- Affected
- <3.26.0
- Fixed in
- 3.26.0
Twig security issue where escaping was missing when using null coalesce operator
- Affected
- >=3.16.0 <3.19.0
- Fixed in
- 3.19.0
Twig has unguarded calls to `__isset()` and to array-accesses when the sandbox is enabled
- Affected
- <3.11.2 · >=3.12 <3.14.1
- Fixed in
- 3.11.2, 3.14.1
Twig has unguarded calls to `__toString()` when nesting an object into an array
- Affected
- <3.11.2 · >=3.12 <3.14.1
- Fixed in
- 3.11.2, 3.14.1
Twig has a possible sandbox bypass
- Affected
- >=1.0.0 <1.44.8 · >=2.0.0 <2.16.1 · >=3.12.0 <3.14.0 · >=3.0.0 <3.11.1
- Fixed in
- 1.44.8, 2.16.1, 3.11.1, 3.14.0
Twig Path Traversal vulnerability in the filesystem loader
- Affected
- >=1.0.0 <1.12.3
- Fixed in
- 1.12.3
Twig may load a template outside a configured directory when using the filesystem loader
- Affected
- >=1.0.0 <1.44.7 · >=2.0.0 <2.15.3 · >=3.0.0 <3.4.3
- Fixed in
- 1.44.7, 2.15.3, 3.4.3
Twig remote code execution in templates
- Affected
- <1.20.0
- Fixed in
- 1.20.0
Twig Sandbox Information Disclosure
- Affected
- <1.38.0 · >=2.0.0 <2.7.0
- Fixed in
- 1.38.0, 2.7.0
Code injection in Twig
- Affected
- >=2.0.0 <2.14.11 · >=3.0.0 <3.3.8
- Fixed in
- 2.14.11, 3.3.8
Is your twig/twig version vulnerable?
- twig/twig 3.30No known advisories in 3.30.0
- twig/twig 3.29No known advisories in 3.29.0
- twig/twig 3.28No known advisories in 3.28.0
- twig/twig 3.27No known advisories in 3.27.1
- twig/twig 3.265 advisories in 3.26.0
- twig/twig 3.2515 advisories in 3.25.0
- twig/twig 2.1613 advisories in 2.16.1
- twig/twig 2.1513 advisories in 2.15.6
- twig/twig 2.1414 advisories in 2.14.13
- twig/twig 2.1315 advisories in 2.13.1
- twig/twig 2.1215 advisories in 2.12.5
- twig/twig 2.1115 advisories in 2.11.3
- twig/twig 1.4412 advisories in 1.44.8
- twig/twig 1.4314 advisories in 1.43.1
- twig/twig 1.4214 advisories in 1.42.5
- twig/twig 1.4114 advisories in 1.41.0
- twig/twig 1.4014 advisories in 1.40.1
- twig/twig 1.3914 advisories in 1.39.1
Which of your client projects still run an old twig/twig?
NPMscan reads the composer.lock in every GitHub repo you pick and checks each installed version against these advisories, including the packages your packages pull in. Each finding comes with the command that fixes it.
Other Composer packages
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily. Package details from the Composer registry.