Review 10.4 Merged

69817[TASK] Introduce SVG Sanitizer

Oliver Hader CR +2 V +2 Expert +1804 −2 updated 07/13/21, 11:27

Commit message

This change introduces behavior of extension `t3g/svg-sanitizer` into
the TYPO3 core. Sanitizing SVG data is actually done by external package
`enshrined/svg-sanitize` by Daryll Doyle.

The following aspects are introduced:
+ handle `GeneralUtility::upload_copy_move` invocations
+ handle FAL action events `file-add`, `file-replace`, `set-content`
+ provide upgrade wizard, sanitizing all SVG files in storages that
  are using `LocalDriver`

Custom usage:
```
$sanitizer = new \TYPO3\CMS\Core\Resource\Security\SvgSanitizer();
$sanitizer->sanitizeFile($sourcePath, $targetPath);
$svg = $sanitizer->sanitizeContent($svg);
```

Basically this change enforces following public service announcements
concerning SVG files, to enhance these security aspects per default:
+ https://typo3.org/security/advisory/typo3-psa-2020-003
+ https://typo3.org/security/advisory/typo3-psa-2019-010

Review

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

Issues 1

Files 53

Show 33 more files

Review log 46

  1. Oliver Hader uploaded patch set 1 07/12/21, 18:40

  2. core-ci voted on patch set 1 V +1 07/12/21, 18:49 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13253

  3. Oliver Hader uploaded patch set 2 07/12/21, 19:56

  4. core-ci voted on patch set 2 V +1 07/12/21, 20:09 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13258

  5. Oliver Hader voted on patch set 2 V +2 CR +2 07/13/21, 11:27

  6. Oliver Hader merged patch set 3 07/13/21, 11:27