Review 14.3 Merged

95113[BUGFIX] Sanitize children before unwrapping a/h1-h6 in preview

Oliver Hader CR +2 V +2 Normal +77 −31 updated 08/05/26, 11:40

Commit message

UnwrapTagVisitor reparented the children of <a> and <h1> to <h6>
in enterNode(), before the sanitizer's CommonVisitor ever visited
them. This let disallowed or dangerous nested markup (e.g. script
tags, event attributes, unknown tags) bypass sanitization entirely
and reach the backend page module preview unmodified.

This change moves the unwrap logic to leaveNode(), which runs
after a node's children have already been traversed and sanitized,
so only already-sanitized content is reparented. enterNode() is
now a pure passthrough.

Note: This issue is not classified as a security vulnerability,
since the script execution via the nested payloads is blocked by
the backend Content Security Policy, which does not permit inline
scripts or event handlers.

Reported to the security team by HDWSec (https://hdwsec.fr).

Review

  • Code review CR +2 Done
    • Oliver Hader +2
  • Verified V +2 Done
    • Oliver Hader +2
    • core-ci +1 CI

Issues 1

Files 3

Review log 34

  1. Oliver Hader uploaded patch set 1 08/05/26, 11:29

  2. core-ci voted on patch set 1 V +1 08/05/26, 11:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105973

  3. Oliver Hader voted on patch set 1 CR +2 V +2 08/05/26, 11:39

  4. Oliver Hader merged patch set 2 08/05/26, 11:40