Review main Merged

92139[TASK] Mask database credentials in stacktrace

Simon Praetorius CR +2 V +2 Easy +9 −9 updated 12/30/25, 09:47

Commit message

If `displayErrors` is enabled, TYPO3 shows full stacktraces for
exceptions. This is also the case if the database connection didn't
work (wrong password, server not available, ...). This stacktrace
might then contain the database credentials as plain text.

This patch marks the relevant parameters in `ConnectionPool` and
`Connection` as sensitive parameter, which prevents that output.

Review

  • Code review CR +2 Done
    • Simon Praetorius +2
    • Oliver Klee +1
    • Garvin Hicking +1
    • Sven Liebert +1
    • Mathias Brodala +1
  • Verified V +2 Done
    • Simon Praetorius +2
    • Sven Liebert +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 1418

  1. Simon Praetorius uploaded patch set 1 12/17/25, 10:36

  2. Mathias Brodala commented on patch set 1 12/17/25, 10:40

    WDYT? IMO the attribute should be added to every single occurrence. Exceptions can occur pretty much in any of these methods. And even if the current code cannot lead to exceptions, future changes and cause exceptions.

    ConnectionPool.php:177

    Would make sense to also add the attribute here ...

    ConnectionPool.php:192

    ... and here ...

    ConnectionPool.php:226

    ... and here ...

    ConnectionPool.php:253

    ... and here ...

    ConnectionPool.php:284

    ... and here ...

    ConnectionPool.php:298

    ... and here ...

    ConnectionPool.php:341

    ... and here.
  3. core-ci voted on patch set 1 V +1 12/17/25, 10:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/92340

  4. Simon Praetorius uploaded patch set 2 V +1 12/17/25, 10:47

  5. Simon Praetorius commented on patch set 2 12/17/25, 10:49

    Reply

    I assumed that my local test hit at least one of these methods, but it didn't. I added the attribute to all relevant methods.

    ConnectionPool.php:177 Reply

    Done

    ConnectionPool.php:192 Reply

    Done

    ConnectionPool.php:226 Reply

    Done

    ConnectionPool.php:253 Reply

    Done

    ConnectionPool.php:284 Reply

    Done

    ConnectionPool.php:298 Reply

    Done

    ConnectionPool.php:341 Reply

    Done
  6. Mathias Brodala commented on patch set 2 12/17/25, 10:51

    Should we do the same for Connection while we're at it? It currently only gets the parameters via constructor AFAIS.
  7. core-ci voted on patch set 2 V +1 12/17/25, 10:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/92341

  8. Simon Praetorius uploaded patch set 3 V +1 12/17/25, 10:55

  9. Simon Praetorius commented on patch set 3 12/17/25, 10:55

    Reply

    Done
  10. core-ci voted on patch set 3 V +1 12/17/25, 11:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/92342

  11. Mathias Brodala updated the commit message in patch set 4 V +1 12/17/25, 11:07

  12. Mathias Brodala commented on patch set 4 CR +1 12/17/25, 11:08

    As discussed, this makes sense for v12, too.
  13. core-ci voted on patch set 4 V +1 12/17/25, 11:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/92343

  14. Oliver Klee voted on patch set 4 CR +1 12/17/25, 11:20

  15. Garvin Hicking voted on patch set 4 CR +1 12/17/25, 12:49

  16. Sven Liebert voted on patch set 4 CR +1 V +1 12/29/25, 22:35

  17. Simon Praetorius voted on patch set 4 CR +2 V +2 12/30/25, 09:47

  18. Simon Praetorius merged patch set 5 12/30/25, 09:47