Problem/Motivation
Drupal includes symfony/intl as an indirect dependency. I'm not sure exactly what depends on it in core.
We could require php/intl to be installed as a system requirement, and then exclude the polyfill as a dependency. This would slightly reduce our surface for Symfony CVEs like the one today.
Comments
Comment #2
catchComment #3
macsim commentedThis is a great initiative, especially given the recent CVE on symfony/polyfill-intl-idn.
Drupal core never calls any
intlfunctions directly - they are only used internally by Symfony packages (symfony/string,symfony/mime,egulias/email-validator), so the polyfills are purely transitive dependencies.Proposed approach:
"ext-intl": "*"tocore/composer.json.symfony/polyfill-intl-*packages to thereplacesection of the rootcomposer.json, mirroring howsymfony/polyfill-php72throughphp85are already handled.composer/Metapackage/CoreRecommended/composer.json.'intl'to$required_extensionsinSystemRequirements.php.composer.lock.ext-intlis already enabled by default in most PHP distributions and hosting environments, so the impact on existing installations should be minimal.We could also use
ext-intldirectly where relevant, rather than just relying on it transitively through Symfony. For instance, Unicode normalization via\Normalizer::normalize()or IDN handling viaidn_to_ascii()/idn_to_utf8()in email/URL validation. That would make the requirement more justified and reduce indirect coupling with Symfony internalsComment #4
longwaveDo you have a source for this information?
Comment #5
macsim commentedHmm no, my bad, I'm so used to
ext-intlbeing enabled in the environments I work with that I probably made a false claim. I just quickly checked some official PHP 8.x Docker images do not include it by default (docker-php-ext-install intlis required explicitly).Comment #6
longwaveYeah, I'm not sure it's available everywhere, which is why I asked - I think this would make Drupal harder to install for some users, and it's the reason the polyfill exists in the first place.
To me this is a bit of a kneejerk reaction to Symfony's most recent update and policy on fixes; historically we have never had problems with this (or any other polyfill), so next time this happens it's just as likely to be some other Symfony component causing the trouble.
Given the lack of issues we've had with the polyfills (until now) and the fact they are all indirect dependencies (I think?) perhaps we should just loosen the constraints on them in
core-recommendedfrom the~operator to the^operator.Comment #7
catchSince https://github.com/symfony/polyfill/issues/585 there are no regular minor releases of the polyfills at all. How do we know they won't start a new major branch, go several releases without tagging a release for a specific polyfill and then release a cve for it at zero warning without a backport to the previous major? Are we going to widen the constant to * their have the same problem again?
The release cycle is completely divorced from the actual Symfony components and as far as I can tell undocumented. And per https://github.com/symfony/polyfill/issues/621 they do not seem open to discussing changes or mitigations to their current approach.
Comment #8
longwaveMaybe we shouldn't have purely transitive dependencies in
core-recommendedat all? If we don't explicitly use them ourselves, it shouldn't matter which version we pick; we should be able to trust upstream's judgement.Comment #9
jamesoakley+1
I see there are now 3 symfony packages and 5 twig packages with a vulnerability advisory. For nimbleness and ease, those should be fixable without having to go through the release process of core each time.
Comment #10
macsim commentedAgreeing with #8 on the principle - purely transitive dependencies that core doesn't explicitly use probably shouldn't be pinned in
core-recommended.However, doing this without first requiring
ext-intlas suggested by catch leaves a risk: polyfill major versions can introduce behavioral differences on edge cases (Unicode normalization, IDN handling, etc.). A contrib or custom module that implicitly relies on that behavior could silently regress when the version changes, with no obvious paper trail. The risk for the broader ecosystem is non-zero.That said, requiring a php extension that core only uses transitively - solely to protect third-party projects from a hypothetical regression - seems hard to justify.
Any module relying on intl functions should declare the dependency itself - either
symfony/polyfill-intl-*orext-intl- in its owncomposer.json. Relying on core pulling it in transitively is a packaging defect, not core's responsibility.#8 alone seems fair enough
Comment #11
sk_10 commentedThere were issues updating the core to highly critical version update for both the versions: 10 and 11 https://www.drupal.org/project/drupal/releases/10.6.9
The issue got fixed after updating to the higher versions 10.6.10 and 11.3.11
Thanks team for quick turn around fix!