Review main Merged

95854[BUGFIX] Avoid serving a partially written resized image

Benni Mack CR +2 V +2 Normal +95 −2 updated 09/16/26, 11:07

Commit message

GraphicalFunctions::resize() checks file_exists($output) and then
has the image processor write directly to that path, with no
temporary name and no rename(). Two concurrent requests resizing
the same not-yet-cached image can both see "missing" and both start
converting; a third request arriving in between sees
file_exists($output) === true while the file is still being
written, and can serve (or, with base64 embedding, read) a
truncated image - which can then be cached into the page cache
until the next flush.

combineExec(), used to compose masked images, has the identical
pattern: it writes its composed result straight to the public
output path with a direct shell command, with no temporary name
and no rename() either.

FAL's own processing was never exposed to this, since its output is
always moved into _processed_/ via rename() before a public URL is
handed out. A path that serves processed images directly from an
uncached frontend request - such as GifBuilder, or any future
processor writing straight to typo3temp/assets/images/ - is exposed
to it on every render, not just a backend queue.

Convert into a private temporary file first and rename() it onto
the public path only once conversion has finished, so
file_exists() is only ever true for a complete file, in both
methods. The target file extension is kept as the temporary name's
trailing extension, since the image processor infers the output
format from it.

Review

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

Issues 1

Files 2

Review log 68

  1. Benni Mack uploaded patch set 1 09/15/26, 12:25

  2. core-ci voted on patch set 1 V +1 09/15/26, 12:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108617

  3. Benni Mack uploaded patch set 2 V +1 09/15/26, 13:12

  4. core-ci voted on patch set 2 V +1 09/15/26, 13:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108620

  5. Benni Mack marked it ready for review 09/15/26, 19:27

  6. Georg Ringer voted on patch set 2 CR +1 V +1 09/16/26, 09:47

  7. Benni Mack voted on patch set 2 CR +2 V +2 09/16/26, 11:07

  8. Benni Mack merged patch set 3 09/16/26, 11:07