Review main Merged

86611[BUGFIX] Log debug message on Reaction payload JSON decode error

Mathias Brodala CR +2 V +2 Easy +20 −5 updated 10/21/26, 13:36

Commit message

The "debug" level was chosen here to prevent flooding the TYPO3 logs
which by default log messages of "warning" and higher.

Review

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

Issues 1

Files 3

Review log 2732

Show 47 earlier messages
  1. Mathias Brodala uploaded patch set 1 10/16/24, 14:49

  2. core-ci voted on patch set 1 V +1 10/16/24, 14:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67887

  3. Mathias Brodala uploaded patch set 2 V +1 10/16/24, 14:59

  4. core-ci voted on patch set 2 V +1 10/16/24, 15:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67889

  5. Garvin Hicking commented on patch set 2 CR +1 V +1 10/16/24, 16:11

    Logging this in debug sounds reasonable to me (shouldn't occur in production then and produce possibly huge log files).
  6. Oliver Hader updated the commit message in patch set 3 CR +1 V +1 10/18/24, 13:54

  7. core-ci voted on patch set 3 V +1 10/18/24, 19:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68079

  1. Garvin Hicking voted on patch set 3 CR +1 V +1 10/18/24, 19:17

  2. Christian Kuhn voted on patch set 3 CR +1 V +1 01/14/25, 14:33

  3. Benjamin Franzke commented on patch set 3 CR -2 01/14/25, 15:37

  4. Christian Kuhn commented on patch set 3 01/14/25, 15:49

    ReactionHandler.php:83 Reply

    ack. which data is fine to log here? looking at your reference, it seems 'message' is fine from a security point of view and logging the full exception (with trace) is not. what about payload/body?
  5. Benjamin Franzke commented on patch set 3 01/14/25, 16:17

    ReactionHandler.php:83 Reply

    ack, that's what we need to decide. and questions like fullpath-information (as brought up in other patches) play into that… I think we should adapt the logger – https://github.com/TYPO3/typo3/blob/1bd1923ef7fb3290e9e8303a2a30bc34c1dc83f6/typo3/sysext/core/Classes/Log/Writer/FileWriter.php#L150 – first to reduce the likelihood of slip-throughs as in https://typo3.org/security/advisory/typo3-core-sa-2025-001. E.g. by always formatting the exception with minimal information, but without a trace (instead of just stringifying it). Then maybe(?) wait for custom log-writers to do the same and then patches like this can go in. I know, that sounds like quite some delay, but I want to prevent a new security-issue here.
  6. Christian Kuhn commented on patch set 3 01/27/25, 13:36

    ReactionHandler.php:83 Reply

    Ok. So we leave out $e, but keep $body: There is a full $this->logger->info($request) in handleReaction() above, we could follow with this case here, I suppose. I guess we could handle improvements of the logger with dedicated patches and could push this one forward meanwhile? Would you like to update this change to exclude $e, Benjamin?
  7. Garvin Hicking commented on patch set 3 04/08/26, 20:03

    ReactionHandler.php:83 Reply

    bump?
  8. Benni Mack updated the commit message in patch set 4 CR +1 V +1 04/22/26, 06:26

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  9. core-ci voted on patch set 4 V -1 04/22/26, 06:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100702

  10. Christian Kuhn wrote 06/18/26, 23:08

    Removed reviewer Christian Kuhn.
  11. Garvin Hicking abandoned the change 10/02/26, 12:28

    no more feedback
  12. Mathias Brodala restored the change 10/02/26, 12:39

  13. Mathias Brodala commented on patch set 4 10/02/26, 12:40

    This is still relevant but I'd also like to have feedback how to proceed.
  14. Benjamin Franzke uploaded patch set 5 V -1 10/07/26, 10:43

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  15. Benjamin Franzke commented on patch set 5 10/07/26, 10:43

    ReactionHandler.php:83 Reply

    I'm sorry for not comming back to this, I lost track of this review. I'm actually unsure, since we have other cases where we already allow similar exceptions. One intresting case is the following, which allowed exception logging in debug scenarios: > 74903: [SECURITY] Do not log stacktrace in exception handlers | https://review.typo3.org/c/Packages/TYPO3.CMS/+/74903 Since this is a `debug` log I would actually say we *could allow to add the full exception*, on the other hand there is one thing to consider: The trace is not relevant. I agree though, that the payload is relevant, since json_decode almost always only responds with a message like "Syntax error" and since debug log needs to be explicitly enabled via TYPO3_CONF_VARS.LOG (debug preset alone does not suffice), we are fine with logging the payload for debugging purposes. I've adapted the patch accordingly. Hope that's fine with you.
  16. Benjamin Franzke commented on patch set 5 10/07/26, 10:43

    Reply

    Done
  17. core-ci voted on patch set 5 V +1 10/07/26, 10:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110301

  18. Mathias Brodala commented on patch set 5 10/07/26, 12:44

    ReactionHandler.php:82

    IMO this should be the last line of the method. This way we avoid a type error in case the PayloadDecoder ever starts throwing other kinds of exceptions.
  19. Mathias Brodala commented on patch set 5 10/07/26, 12:44

    ReactionHandler.php:83 Reply

    Perfectly fine with me, thanks.
  20. Garvin Hicking commented on patch set 5 CR +1 V +1 10/07/26, 12:50

    (I'm fine either way with the placement of the try/catch line[s])
  21. Garvin Hicking commented on patch set 5 CR +2 V +2 10/10/26, 08:48

    ReactionHandler.php:82 Reply

    I think it's fine for the time being, if we modify the exceptions I would expect modifications check for current usages of the method and see that catches need adoption.
  22. Garvin Hicking commented on patch set 5 CR +1 V +1 10/10/26, 08:50

    Backport needs love 🫣
  23. Garvin Hicking voted on patch set 5 CR +2 V +2 10/21/26, 11:57

  24. Garvin Hicking commented on patch set 5 10/21/26, 13:34

    Reply

    Done
  25. Garvin Hicking merged patch set 6 10/21/26, 13:36