Commit Graph

8008 Commits

Author SHA1 Message Date
Fabien Potencier 653afe5c97 Remove dead SYMFONY_PHPUNIT_VERSION env 2026-05-24 11:13:32 +02:00
Fabien Potencier af449aa039 Merge branch '3.x' into 4.x
* 3.x:
  Set LANG=en_US.UTF-8 for the extra packages tests
  Use per-extension PHPUnit bridge and force PHPUnit 11 on PHP 8.2+
  Install a custom exception handler before bootstrapping KernelTestCase
  Simplify code

# Conflicts:
#	.github/workflows/ci.yml
#	extra/twig-extra-bundle/phpunit.xml.dist
2026-05-24 11:11:20 +02:00
Fabien Potencier 12f0dc2a1e minor #4811 Set LANG=en_US.UTF-8 for the extra packages tests (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Set LANG=en_US.UTF-8 for the extra packages tests

Commits
-------

d016d2439f Set LANG=en_US.UTF-8 for the extra packages tests
2026-05-24 11:06:21 +02:00
Fabien Potencier d016d2439f Set LANG=en_US.UTF-8 for the extra packages tests 2026-05-24 11:00:21 +02:00
Fabien Potencier ee8e1b8651 minor #4810 Use modern PHPUnit for extra packages (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Use modern PHPUnit for extra packages

Commits
-------

25d7eb60d7 Use per-extension PHPUnit bridge and force PHPUnit 11 on PHP 8.2+
54420847f0 Install a custom exception handler before bootstrapping KernelTestCase
2026-05-24 10:52:50 +02:00
Fabien Potencier 25d7eb60d7 Use per-extension PHPUnit bridge and force PHPUnit 11 on PHP 8.2+ 2026-05-24 10:42:56 +02:00
Fabien Potencier 54420847f0 Install a custom exception handler before bootstrapping KernelTestCase 2026-05-24 10:42:35 +02:00
Fabien Potencier 85013f01b3 minor #4809 Simplify code (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Simplify code

Commits
-------

49e59e4612 Simplify code
2026-05-24 10:00:35 +02:00
Fabien Potencier 49e59e4612 Simplify code 2026-05-24 09:57:49 +02:00
Fabien Potencier 11d5cb5bd1 Replace @dataProvider annotations with #[DataProvider] attributes 2026-05-23 11:36:24 +02:00
Fabien Potencier 0ab904677b Fix risky test 2026-05-23 11:34:00 +02:00
Fabien Potencier 638869ee9e Fix CS 2026-05-23 11:32:44 +02:00
Fabien Potencier 3dc9dc82d6 Fix PHPStan errors 2026-05-23 11:31:58 +02:00
Fabien Potencier f3e9b55805 Remove deprecated code 2026-05-23 11:27:44 +02:00
Fabien Potencier 22d41ed29f Fix merge conflict resolution 2026-05-23 10:34:41 +02:00
Fabien Potencier 172e48a853 Merge branch '3.x' into 4.x
* 3.x:
  Escape root profile name in HtmlDumper
  Restrict allowed classes in Profile::unserialize()
  Fix typo
  Bump version
  Deprecate the "Twig\Sandbox\SourcePolicyInterface" interface

# Conflicts:
#	CHANGELOG
#	doc/deprecated.rst
#	src/Environment.php
#	tests/Extension/SandboxTest.php
2026-05-23 10:14:05 +02:00
Fabien Potencier fe6cbf9fcb bug #4807 Escape root profile name in HtmlDumper (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Escape root profile name in HtmlDumper

Commits
-------

f6aca309d8 Escape root profile name in HtmlDumper
2026-05-23 09:39:33 +02:00
Fabien Potencier f6aca309d8 Escape root profile name in HtmlDumper 2026-05-23 09:39:26 +02:00
Fabien Potencier ead63cc824 bug #4808 Restrict allowed classes in Profile::unserialize() (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Restrict allowed classes in Profile::unserialize()

Commits
-------

4c1dae5e71 Restrict allowed classes in Profile::unserialize()
2026-05-23 09:38:46 +02:00
Fabien Potencier 4c1dae5e71 Restrict allowed classes in Profile::unserialize() 2026-05-23 09:09:19 +02:00
Fabien Potencier c6bbae295b Fix typo 2026-05-23 09:03:34 +02:00
Fabien Potencier 4fc0210084 Bump version 2026-05-23 08:32:22 +02:00
Fabien Potencier 3ef56b7284 feature #4803 Deprecate the "Twig\Sandbox\SourcePolicyInterface" interface (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Deprecate the "Twig\Sandbox\SourcePolicyInterface" interface

I'm deprecating this feature for the following main reasons:

* AFAICS, no open-source projects is using this feature and the only repository using it has 0 stars and 0 downloads on Packagist - if nobody find value in this feature, it's better to remove it
* As much as possible, a better strategy is to render templates written by untrusted users via a specific loader that restrict what the sandbox environment can "see".

Commits
-------

bd924d5d33 Deprecate the "Twig\Sandbox\SourcePolicyInterface" interface
2026-05-23 08:30:15 +02:00
Fabien Potencier bd924d5d33 Deprecate the "Twig\Sandbox\SourcePolicyInterface" interface 2026-05-23 08:30:05 +02:00
Fabien Potencier 97a9727e52 Merge branch '3.x' into 4.x
* 3.x:
  Remove Drupal integration tests
  Do not add : void for test methods
  Fix deprecated PHP CS Fixer rules
  Replace FQCN with use statements in SandboxTest
  Fix CS

# Conflicts:
#	.github/workflows/ci.yml
#	tests/Extension/SandboxTest.php
2026-05-22 12:46:51 +02:00
Fabien Potencier af86a386bf minor #4806 Remove Drupal integration tests (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Remove Drupal integration tests

Commits
-------

0a80d1a9aa Remove Drupal integration tests
2026-05-22 12:42:33 +02:00
Fabien Potencier 0a80d1a9aa Remove Drupal integration tests 2026-05-22 12:38:21 +02:00
Fabien Potencier fb3ca5e089 minor #4805 Replace FQCN with use statements in SandboxTest (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Replace FQCN with use statements in SandboxTest

Commits
-------

d8781e473c Do not add : void for test methods
ed6df6b4b4 Fix deprecated PHP CS Fixer rules
2026-05-22 12:31:26 +02:00
Fabien Potencier d8781e473c Do not add : void for test methods 2026-05-22 12:29:27 +02:00
Fabien Potencier ed6df6b4b4 Fix deprecated PHP CS Fixer rules 2026-05-22 12:25:06 +02:00
Fabien Potencier c006ad2f67 minor #4805 Replace FQCN with use statements in SandboxTest (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Replace FQCN with use statements in SandboxTest

Commits
-------

a0a1f1d17d Replace FQCN with use statements in SandboxTest
2026-05-22 12:11:50 +02:00
Fabien Potencier a0a1f1d17d Replace FQCN with use statements in SandboxTest 2026-05-22 12:08:11 +02:00
Fabien Potencier 4a64b5b486 Fix CS 2026-05-21 16:34:23 +02:00
Fabien Potencier cbaa485734 Remove 3.x deprecation warning from attribute function docs 2026-05-21 14:53:50 +02:00
Fabien Potencier 4eb02560ea Remove versionadded in docs 2026-05-21 14:45:29 +02:00
Fabien Potencier b91dbaa1ba Fix merge conflict resolution 2026-05-21 14:11:53 +02:00
Fabien Potencier 8dd0383353 Merge branch '3.x' into 4.x
* 3.x: (23 commits)
  Bump version
  Prepare the 3.26.0 release
  Update CHANGELOG
  Document that the sandbox doesn't protect against resource exhaustion
  Document template_from_string caveats when used in a sandboxed env
  Pre-escape HTML input on the `spaceless` filter
  Add docs on Markup about the goal of this class in the context of a sandbox
  Fix sandbox bypass in the "column" filter
  Fix sandbox `__toString` bypasses
  Validate macro name in MacroReferenceExpression constructor
  Fix sandbox bypass: PHP code injection via _self / import macro reference
  Fix deprecations in tests
  Fix sandbox bypass in the `{% sandbox %}` tag when including a preloaded template
  Encode single quotes as \x27 in Compiler::string()
  Fix sandbox bypass: PHP code injection via {% use %} template name
  Fix unbounded memoisation of `IntlDateFormatter` / `NumberFormatter`
  Fix deprecation
  [Profiler] Escape template and profile names in HtmlDumper
  Bump version
  Fix sandbox bypass: propagate sandbox state to checkArrow for source-policy sandboxing
  ...

# Conflicts:
#	CHANGELOG
#	doc/filters/spaceless.rst
#	extra/cssinliner-extra/CssInlinerExtension.php
#	extra/inky-extra/InkyExtension.php
#	extra/markdown-extra/MarkdownExtension.php
#	src/Environment.php
#	src/ExpressionParser/Infix/DotExpressionParser.php
#	src/Extension/CoreExtension.php
#	src/Node/Expression/FilterExpression.php
#	src/Node/Expression/FunctionExpression.php
#	src/Node/Expression/TestExpression.php
#	src/Node/ModuleNode.php
#	src/NodeVisitor/SandboxNodeVisitor.php
#	src/Resources/core.php
#	src/TokenParser/SandboxTokenParser.php
#	tests/Extension/SandboxTest.php
2026-05-21 13:58:45 +02:00
Fabien Potencier 91b3d5182d Bump version 2026-05-20 09:32:26 +02:00
Fabien Potencier 1fcae487b1 Prepare the 3.26.0 release v3.26.0 2026-05-20 09:31:59 +02:00
Fabien Potencier 40d4f8a4ab Update CHANGELOG 2026-05-20 09:23:11 +02:00
Fabien Potencier 116dae25bc security #cve-2026-46627 Document that the sandbox doesn't protect against resource exhaustion (fabpot)
This PR was merged into the twig-3.x branch.
2026-05-20 09:16:35 +02:00
Fabien Potencier 6bfa285e2f Document that the sandbox doesn't protect against resource exhaustion 2026-05-20 09:12:32 +02:00
Fabien Potencier 7923de168b security #cve-2026-46628 Pre-escape HTML input on the spaceless filter (fabpot)
This PR was merged into the twig-3.x branch.
2026-05-20 08:53:45 +02:00
Fabien Potencier 47ca88d78b security #cve-2026-46634 Document template_from_string caveats when used in a sandboxed env (fabpot)
This PR was merged into the twig-3.x branch.
2026-05-20 08:51:01 +02:00
Fabien Potencier 1cde8f2b62 Document template_from_string caveats when used in a sandboxed env 2026-05-20 08:43:49 +02:00
Fabien Potencier 3190b9ae12 Pre-escape HTML input on the spaceless filter 2026-05-20 08:29:48 +02:00
Fabien Potencier b9e6e654af Add docs on Markup about the goal of this class in the context of a sandbox 2026-05-20 08:14:13 +02:00
Fabien Potencier 673f02cb6d security #cve-2026-46635 Fix sandbox bypass in the "column" filter (alexandre-daubois)
This PR was merged into the twig-3.x branch.
2026-05-20 07:35:59 +02:00
Alexandre Daubois f05c5011c2 Fix sandbox bypass in the "column" filter 2026-05-20 07:33:52 +02:00
Fabien Potencier 2e4b6d286e security #cve-2026-47732 [Sandbox] Fix __toString() support (fabpot)
This PR was merged into the twig-3.x branch.
2026-05-20 07:31:34 +02:00