Problem/Motivation

SVG Image requires enshrined/svg-sanitize >=0.15 <1.0, but enshrined/svg-sanitize is listed on several security advisories and this prevents a clean install of SVG Image.

Steps to reproduce

Running `composer require drupal/svg_image` on a clean Drupal installation aborts:

   - Root composer.json requires drupal/svg_image ^3.2 -> satisfiable by drupal/svg_image[3.2.0, ..., 3.x-dev].
    - drupal/svg_image[3.2.0, ..., 3.2.1] require enshrined/svg-sanitize >=0.15 <1.0 -> found enshrined/svg-sanitize[0.15.0, ..., 0.22.0] but these were not loaded, because they are affected by security advisories ("PKSA-8j6w-3kr7-s9xk", "PKSA-6j95-1jtb-x6wc", "PKSA-cbx2-m9db-bmzd", "PKSA-4g5g-4rkv-myqs"). Go to https://packagist.org/security-advisories/ to find advisory details. To ignore the advisories, add their IDs to the "policy.advisories.ignore-id" config or add the package to "policy.advisories.ignore". To turn the feature off entirely, you can set "policy.advisories.block" to false.

Proposed resolution

There is no significant change in enshrined/svg-sanitize ^1.0, so increase the require to ^1.0

Remaining tasks

Refactor composer.json:

   …
   "require": {
        "enshrined/svg-sanitize": "^1.0"
    }

User interface changes

None

API changes

None

Data model changes

None

Issue fork svg_image-3629505

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

murrow created an issue. See original summary.

drupal-son’s picture

Same issue

greatmatter’s picture

Thank you for this! Looking forward to the release.

andre.bonon’s picture

Hi, I noticed that the merge request hasn't been created yet. As the code looks good to me, I've just created the merge request.

murrow’s picture

Oops, thank you, andre.bonon. My bad

jurgenhaas’s picture

Priority: Major » Critical
Status: Active » Reviewed & tested by the community

Changing this to critical. I hope there can be a quick patch release with the MR being merged.

eduardo morales alberti’s picture

+1 to it

vitaliyb98’s picture

+1, looking forward

aporie’s picture

+1 too

lmoeni’s picture

+1

mably’s picture

Thanks all. I compared enshrined/svg-sanitize 0.22.0 and 1.0.0: no public method was removed or changed, and svg_image only calls (new Sanitizer())->sanitize() with the defaults. The only behaviour change on that path is that DOCTYPE/DTD blocks are now always stripped, which is the XSS fix itself, so !65 is safe as is.

The failing phpstan job is unrelated (the private $logger in SvgResponsiveImageFormatter, #3562651). I'll merge both and tag a release shortly.

AI-Generated: Yes (Claude Code was used to compare the two library versions and to help draft this comment. I reviewed it.)

steveoriol’s picture

+1

mably’s picture

Status: Reviewed & tested by the community » Fixed

Merged. Thanks everybody!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

mably’s picture

3.2.5 has been released with the fix.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.