Review 14.3 Merged

97234[BUGFIX] Accept Office documents detected as container format

Benni Mack CR +2 V +2 Normal +201 −3 updated 10/30/26, 11:54

Commit message

Office Open XML and OpenDocument files are ZIP archives, legacy
Office files are OLE compound files. Depending on the libmagic
version and on the application which wrote a file, finfo only
detects the container format, such as application/zip or
application/CDFV2. With the file extension and MIME type consistency
check, which is enabled by default, such files were rejected on
upload, and files in the index were stored with the generic type.

"mimeTypeCompatibility" now maps these container types to the
concrete Office MIME type by the file extension. Only the Office
extensions listed in the default "miscfile_ext" are mapped.

This affects the upload validation of ResourceConsistencyService and
FileExtensionMimeTypeConsistencyValidator: a file detected as a
container type is accepted if its extension is one of the mapped
Office extensions. libmagic detects the concrete Office type by the
content, never by the file name, so a plain ZIP archive named
"report.docx" was rejected on every system before and now passes,
as does any ZIP archive or OLE compound file with a mapped Office
extension. This adds no capability for an attacker, as the content
detection of ZIP containers is already satisfied by putting a
"[Content_Types].xml" entry first, and the allowed file extensions
and "fileDenyPattern" are unchanged. Other combinations, such as a
ZIP archive named "report.pdf", are still rejected.

Review

  • Code review CR +2 Done
    • Benni Mack +2
  • Verified V +2 Done
    • Benni Mack +2
    • core-ci +1 CI

Issues 1

Files 5

Review log 711

  1. Benni Mack commented on patch set 1 10/30/26, 10:52

    Cherry Picked from branch main. The following files contain Git conflicts: * typo3/sysext/core/Tests/Functional/Resource/Service/ResourceConsistencyServiceTest.php
  2. Benni Mack commented on patch set 2 10/30/26, 10:53

    Published edit on patch set 1.
  3. Benni Mack marked it ready for review 10/30/26, 10:53

  4. core-ci voted on patch set 1 V -1 10/30/26, 11:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112853

  5. core-ci voted on patch set 2 V -1 10/30/26, 11:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112854

  6. Benni Mack commented on patch set 3 V -1 10/30/26, 11:09

    Published edit on patch set 2.
  7. core-ci voted on patch set 3 V -1 10/30/26, 11:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112859

  8. Benni Mack commented on patch set 4 V -1 10/30/26, 11:25

    Published edit on patch set 3.
  9. core-ci voted on patch set 4 V +1 10/30/26, 11:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112864

  10. Benni Mack voted on patch set 4 CR +2 V +2 10/30/26, 11:54

  11. Benni Mack merged patch set 5 10/30/26, 11:54