Under some circumstances, the sandbox security checks are not run which allows user-contributed templates to bypass the sandbox restrictions.
The security issue happens when all these conditions are met:
The sandbox is disabled globally;
The sandbox is enabled via a sandboxed include() function which references a template name (like included.twig) and not a Template or TemplateWrapper instance;
The included template has been loaded before the include() call but in a non-sandbox context (possible as the sandbox has been globally disabled).
Resolution
The patch ensures that the sandbox security checks are always run at runtime.
Credits
We would like to thank Fabien Potencier for reporting and fixing the issue.
Release Notes
twigphp/Twig (twig/twig)
### [`v3.14.0`](https://redirect.github.com/twigphp/Twig/blob/HEAD/CHANGELOG#3140-2024-09-09)
[Compare Source](https://redirect.github.com/twigphp/Twig/compare/v3.13.0...v3.14.0)
- Fix a security issue when an included sandboxed template has been loaded before without the sandbox context
- Add the possibility to reset globals via `Environment::resetGlobals()`
- Deprecate `Environment::mergeGlobals()`
### [`v3.13.0`](https://redirect.github.com/twigphp/Twig/blob/HEAD/CHANGELOG#3130-2024-09-07)
[Compare Source](https://redirect.github.com/twigphp/Twig/compare/v3.12.0...v3.13.0)
- Add the `types` tag (experimental)
- Deprecate the `Twig\Test\NodeTestCase::getTests()` data provider, override `provideTests()` instead.
- Mark `Twig\Test\NodeTestCase::getEnvironment()` as final, override `createEnvironment()` instead.
- Deprecate `Twig\Test\NodeTestCase::getVariableGetter()`, call `createVariableGetter()` instead.
- Deprecate `Twig\Test\NodeTestCase::getAttributeGetter()`, call `createAttributeGetter()` instead.
- Deprecate not overriding `Twig\Test\IntegrationTestCase::getFixturesDirectory()`, this method will be abstract in 4.0
- Marked `Twig\Test\IntegrationTestCase::getTests()` and `getLegacyTests()` as final
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, check this box
This PR contains the following updates:
3.12.0
->3.14.0
GitHub Vulnerability Alerts
CVE-2024-45411
Description
Under some circumstances, the sandbox security checks are not run which allows user-contributed templates to bypass the sandbox restrictions.
The security issue happens when all these conditions are met:
include()
function which references a template name (likeincluded.twig
) and not aTemplate
orTemplateWrapper
instance;include()
call but in a non-sandbox context (possible as the sandbox has been globally disabled).Resolution
The patch ensures that the sandbox security checks are always run at runtime.
Credits
We would like to thank Fabien Potencier for reporting and fixing the issue.
Release Notes
twigphp/Twig (twig/twig)
### [`v3.14.0`](https://redirect.github.com/twigphp/Twig/blob/HEAD/CHANGELOG#3140-2024-09-09) [Compare Source](https://redirect.github.com/twigphp/Twig/compare/v3.13.0...v3.14.0) - Fix a security issue when an included sandboxed template has been loaded before without the sandbox context - Add the possibility to reset globals via `Environment::resetGlobals()` - Deprecate `Environment::mergeGlobals()` ### [`v3.13.0`](https://redirect.github.com/twigphp/Twig/blob/HEAD/CHANGELOG#3130-2024-09-07) [Compare Source](https://redirect.github.com/twigphp/Twig/compare/v3.12.0...v3.13.0) - Add the `types` tag (experimental) - Deprecate the `Twig\Test\NodeTestCase::getTests()` data provider, override `provideTests()` instead. - Mark `Twig\Test\NodeTestCase::getEnvironment()` as final, override `createEnvironment()` instead. - Deprecate `Twig\Test\NodeTestCase::getVariableGetter()`, call `createVariableGetter()` instead. - Deprecate `Twig\Test\NodeTestCase::getAttributeGetter()`, call `createAttributeGetter()` instead. - Deprecate not overriding `Twig\Test\IntegrationTestCase::getFixturesDirectory()`, this method will be abstract in 4.0 - Marked `Twig\Test\IntegrationTestCase::getTests()` and `getLegacyTests()` as finalConfiguration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.