Review main Merged

62735[FEATURE] Introduce status report for ExceptionHandler

Susi Moog CR +2 V +2 Normal +57 −0 updated 01/16/20, 11:35

Commit message

The DebugExceptionHandler will display full error messages
and stack traces and should not be used in production.

To mitigate the information disclosure, a new status report has
been introduced:
- if display errors is set to 1 (-> uses DebugExceptionHandler setting)
  and context is Production an Error is displayed
- if display errors is set to 1 (-> uses DebugExceptionHandler setting)
  and context is Development a Warning is displayed
- if the production exception handler setting is configured to use the
  DebugExceptionHandler an Error is displayed

Review

  • Code review CR +2 Done
    • Daniel Goerz +2
    • Tobi Kretschmann +1
  • Verified V +2 Done
    • Daniel Goerz +2
    • Tobi Kretschmann +1
    • TYPO3com +1 CI

Issues 1

Files 3

Review log 810

  1. Susi Moog uploaded patch set 1 12/17/19, 16:42

  2. Susi Moog updated the commit message in patch set 2 12/17/19, 16:43

  3. TYPO3com voted on patch set 1 V +1 12/17/19, 16:53 Completed build in 10m 57s on Tue, 17 Dec, 04:53 PM Test Summary: 69294 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39487

  4. TYPO3com voted on patch set 2 V +1 12/17/19, 16:56 Completed build in 12m 12s on Tue, 17 Dec, 04:56 PM Test Summary: 69296 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39488

  5. Alexander Schnitzler commented on patch set 2 12/20/19, 10:25

    It's slightly offtopic but shouldn't we consider using the native value of error_reporting instead of our replica in globals and display a warning in the install tool as well, if error_reporting is set to 1, no matter the context? Same goes for display_startup_errors. If and how we mingle that setting with the configuration of exception and error handlers is a different topic but at the moment it's quite confusing that native values aren't used. Same goes for error_reporting but that's also another topic.
  6. Alexander Schnitzler commented on patch set 2 12/22/19, 12:35

    SecurityStatus.php:249

    I had some time to review and I think this first condition is such an edge case that I would not mix it with a quite common case (conditions on 2nd line). If someone sets the DebugExceptionHandler as production exception handler, then we should tell her/him that this is a bad practice and very risky because neither $GLOBALS['TYPO3_CONF_VARS']['SYS']['displayErrors'] nor ini_set('display_errors', '1') has any effect any more.

    SecurityStatus.php:250

    We could get rid of the global here and check ini_get('display_errors') instead. That's currently failsafe as we always override the ini value during bootstrap and it's future proof in case we want to get rid of the global altogether.
  7. Susi Moog commented on patch set 2 01/16/20, 09:47

    SecurityStatus.php:249 Reply Unresolved

    I'd expect to see that as error in the report, too - which is all this is currently about.

    SecurityStatus.php:250 Reply Unresolved

    I would do that in another change and not mix both ways currently. let's get rid of the global in one step.
  8. Tobi Kretschmann voted on patch set 2 V +1 CR +1 01/16/20, 10:56

  9. Daniel Goerz voted on patch set 2 V +2 CR +2 01/16/20, 11:34

  10. Daniel Goerz merged patch set 3 01/16/20, 11:35