Problem/Motivation
Twig once again has security vulnerabilities and Drupal pins the vulnerable versions, preventing composer from installing or updating Drupal.
Problem 1
- Root composer.json requires drupal/core-recommended ^11.3.10 -> satisfiable by drupal/core-recommended[11.3.10].
- drupal/core-recommended 11.3.10 requires twig/twig ~v3.26.0 -> found twig/twig[v3.26.0] but these were not loaded, because they are affected by security advisories ("PKSA-fbvq-z33h-r2np", "PKSA-g9zw-qxh8-pq8w", "PKSA-yd6k-t2gh-1m43", "PKSA-1tmc-rt7x-12w6", "PKSA-xx6c-6d96-db2w"). 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.
Steps to reproduce
- Install Drupal core using
drupal/core-recommended11.3.10. - Run:
composer audit - Observe the vulnerabilities reported for twig/twig.
- Run:
composer update twig/twig -W - Observe that Composer cannot resolve dependencies because the vulnerable version is pinned by
drupal/core-recommended.
Proposed resolution
Update the pinned twig/twig version in
drupal/core-recommended to a non-vulnerable release: v3.27.0
Also, we should consider what to do if this keeps happening more frequently. With AI being used more and more to find vulnerabilities, it's likely that the frequency of vulnerability fixes will increase.
Workaround
composer require "twig/twig": "v3.27.0 as v3.26.0"
Comments
Comment #2
solideogloria commentedComment #3
solideogloria commentedComment #4
solideogloria commentedComment #5
solideogloria commentedComment #6
solideogloria commentedComment #7
cilefen commentedIs this a duplicate of #3592382: Update Twig to v3.27.0?
Comment #8
solideogloria commentedYes, though the linked issue doesn't mention the security issues or inability to install updates.
Comment #10
solideogloria commentedNor does it include the workaround...
Comment #11
solideogloria commentedI copied the issue summary to that issue to provide the useful info.