Review main Merged

83774[BUGFIX] Do not log failed HMAC validations for HashService

Torben Hansen CR +2 V +2 Easy +6 −0 updated 04/16/24, 07:06

Commit message

The new core `HashService` and the deprecated extbase `HashService`
have the function `validateAndStripHmac` to validate and strip a
given HMAC appended string. The function will throw an exception,
if the given string is either too short or the appended HMAC in the
string is not valid.

In context of a TYPO3 extension, those exceptions are usually
thrown, when a given HMAC appended string has been tampered.
Logging those exceptions to sys_log or logfiles make no sense,
since a TYPO3 site owner have no reasonable possibility to
prevent a tampered HMAC appended string being passed to the
`validateAndStripHmac` function.

This change prevents logging of four exceptions caused by potential
manipulated HMAC appended strings.

Additionally, a note has been added to extbase `HashService`, that
exception codes from that class must be removed in v14 in
`AbstractExceptionHandler::IGNORED_HMAC_EXCEPTION_CODES`.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Oliver Klee +1
    • Christoph Lehmann +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Christoph Lehmann +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1416

  1. Torben Hansen uploaded patch set 1 04/12/24, 12:32

  2. core-ci voted on patch set 1 V +1 04/12/24, 12:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55865

  3. Torben Hansen commented on patch set 1 04/12/24, 14:13

    Note, if we apply this to v12, the change must be adapted to exclude v13 exception codes for core HashService and the not in extbase HashService must be removed.
  4. Oliver Klee voted on patch set 1 CR +1 04/12/24, 14:16

  5. Stefan Bürk voted on patch set 1 CR +1 V +1 04/12/24, 14:30

  6. Simon Schaufelberger voted on patch set 1 CR +1 V +1 04/12/24, 14:50

  7. Christoph Lehmann commented on patch set 1 CR +1 V +1 04/12/24, 14:55

    👍
  8. Stefan Bürk commented on patch set 1 CR -1 04/14/24, 16:50

    error in releases line
  9. Stefan Bürk updated the commit message in patch set 2 CR +1 V +1 04/14/24, 16:50

  10. Stefan Bürk commented on patch set 2 CR +1 V +1 04/14/24, 16:50

    Reply

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

  12. Oliver Klee voted on patch set 2 CR +1 04/14/24, 17:43

  13. Simon Schaufelberger voted on patch set 2 CR +1 V +1 04/14/24, 18:46

  14. Christoph Lehmann voted on patch set 2 CR +1 V +1 04/15/24, 07:36

  15. Stefan Bürk voted on patch set 2 CR +2 V +2 04/16/24, 06:58

  16. Stefan Bürk merged patch set 3 04/16/24, 07:06