Problem/Motivation
From the symfony blog:
Twig 3.26.0 is a security release fixing 13 advisories, with two rated critical, three high, four medium, and four low. Almost all of them target the sandbox, the component that lets applications run untrusted templates under an explicit allow-list of tags, filters, functions, properties, and methods. All users running untrusted templates through the sandbox should upgrade immediately.
When I try to update a composer package in my Drupal 11.3.9 project:
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires drupal/core-recommended 11.3.9 -> satisfiable by drupal/core-recommended[11.3.9].
- drupal/core-recommended 11.3.9 requires twig/twig ~v3.22.0 -> found twig/twig[v3.22.0, v3.22.1, v3.22.2] but these were not loaded, because they are affected by security advisories ("PKSA-5k7f-wvjj-jrgw", "PKSA-sjvz-tbbr-vwth", "PKSA-h8hf-ytnd-5t9q", "PKSA-wwb1-81rc-pd65", "PKSA-kvv6-36cr-fkzb", "PKSA-n14z-jjjg-g8vd", "PKSA-3mcc-k66d-pydb", "PKSA-gw7n-z4yx-7xjt", "PKSA-dpx1-78wg-1kqs", "PKSA-21g2-dzjv-sky5"). Go to https://packagist.org/security-advisories/ to find advisory details. To ignore the advisories, add them to the audit "ignore" config. To turn the feature off entirely, you can set "block-insecure" to false in your "audit" config.
Comments
Comment #2
flyke commentedComment #3
flyke commentedTemporary workaround for those that need to finish a project today but are stuck on this:
composer require twig/twig:'3.26 as 3.22.3'Don't assume everything works after that, test rigorously.
In my Drupal 11.3.9 project using canvas and other contrib and custom modules, everything seems to be working.
Comment #4
mukeshaddweb commentedUpdated twig/twig from ~v3.22.0 to ~v3.26.0 to address 13 security advisories
(2 critical). Updated constraints in composer.json, core/composer.json,
composer/Metapackage/CoreRecommended/composer.json, and composer.lock.
Tested: ran PHPUnit Twig template tests — all 107 tests pass.
Comment #5
smustgrave commentedFixes should be in MRs please
Comment #7
solideogloria commentedComment #9
solideogloria commentedI did not just apply the patch. I made the changes myself, and they aren't necessarily the same as the patch.
Comment #10
solideogloria commentedI will also venture a guess that this is probably one of the issues that will be fixed by today's Highly Critical security release (PSA-2026-05-18).
Comment #11
kiwad commentedPatch in 4 seems weird...
adds drush to core ?
Comment #12
solideogloria commentedThat's why I didn't use the patch.
Please review the MR (which is different), not the patch.
Comment #13
smustgrave commentedBut MR is failing the pipeline
Comment #14
solideogloria commentedI don't think that's related...
Is there a way to rerun the whole pipeline?
Comment #15
solideogloria commentedCan someone figure out what's wrong with the pipeline? There are no helpful error messages that I can find.
Comment #16
swentel commentedThese fixes will be included in the upcoming release normally, see https://drupal.community/@drupalsecurity/116607161332319890 - so this should be fine in the end.
Comment #17
solideogloria commentedOkay, will close as duplicate.