Review 13.4 Merged

96898[BUGFIX] Sanitize inline SVG nodes through public API

Oli Bartsch CR +2 V +2 Normal +27 −30 updated 10/20/26, 20:16

Commit message

SvgSanitizer::sanitizeNode() subclassed the enshrined sanitizer with
a sanitizeDocument(\DOMDocument) method of its own, which repeated
the cleaning steps of the library's sanitize() on an existing
document. enshrined/svg-sanitize 1.1.0 introduces a protected
sanitizeDocument($dirty) with a different signature, so declaring
the anonymous class now fails with a fatal error. Any inline SVG
passed through the default HTML sanitizer breaks as soon as 1.1.0
is installed.

The repeated steps were also out of date: 1.1.0 changed the order of
the cleaning steps and added checks the subclass did not run.

The node is now serialized, cleaned with the public sanitize()
method and imported back into the document. No library internals
are used anymore, and later improvements in the library apply
automatically. Whitespace-only text nodes are dropped, as the library
already does when it parses markup itself.

The minimum version of enshrined/svg-sanitize is raised to 1.1.1,
a security release that fixes a regression of 1.1.0, where
sanitize() throws on input that ends inside an unclosed tag:
 - GHSA-f7cw-vfxq-7ph2

Requiring 1.1.1 also ensures the security fixes of 1.1.0:
 - GHSA-2v7c-jx29-jprp
 - GHSA-cgcm-4g72-hfgw
 - GHSA-hrwm-vcc9-hcm4
 - GHSA-94x8-pw3c-6qcq
 - GHSA-vjg7-f2wj-gqqh
 - GHSA-3vh3-jf65-656w
 - GHSA-q546-85r6-f39q

Executed commands:

  composer req enshrined/svg-sanitize:^1.1.1
  composer req -d typo3/sysext/core --no-update \
    enshrined/svg-sanitize:^1.1.1

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
  • Verified V +2 Done
    • Benjamin Franzke +2
    • core-ci +1 CI

Issues 1

Files 5

Review log 610

  1. Oli Bartsch uploaded patch set 1 10/20/26, 07:06

  2. core-ci voted on patch set 1 V +1 10/20/26, 07:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111749

  3. Oli Bartsch updated the commit message in patch set 2 V +1 10/20/26, 08:05

  4. core-ci voted on patch set 2 V +1 10/20/26, 08:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111757

  5. Oli Bartsch uploaded patch set 3 V +1 10/20/26, 09:15

  6. core-ci voted on patch set 3 V +1 10/20/26, 09:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111776

  7. Benjamin Franzke uploaded patch set 4 V +1 10/20/26, 19:53

  8. core-ci voted on patch set 4 V +1 10/20/26, 20:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111935

  9. Benjamin Franzke voted on patch set 4 CR +2 V +2 10/20/26, 20:14

  10. Benjamin Franzke merged patch set 5 10/20/26, 20:16