Review main Merged

77024[TASK] Add HTTP host header injection check to reports module

Oliver Hader CR +2 V +2 Normal +122 −2 updated 12/13/22, 09:12

Commit message

In case the web server scenario is not properly configured to deny
HTTP host header injection, and the trustedHostsPattern is not explicit
enough, a corresponding check in the reports module will issue
an error message like

* HTTP_HOST contained unexpected "a0a3aa2f59.random.example.org"
* SERVER_NAME contained unexpected "a0a3aa2f59.random.example.org"

Using the configuration directive `UseCanonicalName On` for Apache
web server environments mitigates the risk.

Review

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

Issues 1

Files 7

Review log 1620

  1. Oliver Hader uploaded patch set 1 12/12/22, 12:41

  2. core-ci voted on patch set 1 V +1 12/12/22, 12:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34909

  3. Andreas Kienast commented on patch set 1 12/12/22, 14:37

    AjaxRoutes.php:6

    Why is it callable via AJAX if it's only used in an internal PHP request?
  4. Oliver Hader commented on patch set 1 12/12/22, 14:56

    AjaxRoutes.php:6 Reply

    I don't understand the question. The request must be routed through the web server, because that's the aspect that shall be tested. Thus, in any way it must be an HTTP request.
  5. Torben Hansen commented on patch set 1 V +1 CR +1 12/12/22, 17:44

    Looks good to me. I would recommend to additionally rename a label in the system reports section. Current: `Server Response on static files` Suggested: `Server Reponse` This is now misleading, since the new check does not check a static file, but a potential webserver misconfiguration.
  6. Oliver Hader voted on patch set 1 CR -1 12/12/22, 17:45

  7. Oliver Hader uploaded patch set 2 CR +1 V +1 12/12/22, 17:51

  8. core-ci voted on patch set 2 V +1 12/12/22, 17:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34936

  9. Oliver Hader commented on patch set 2 12/12/22, 18:00

    AjaxRoutes.php:6 Reply

    Done
  10. Torben Hansen voted on patch set 2 V +1 CR +1 12/12/22, 18:22

  11. Nikita Hovratov updated the commit message in patch set 3 CR +1 V +1 12/12/22, 18:26

  12. core-ci voted on patch set 3 V +1 12/12/22, 18:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34939

  13. Benni Mack voted on patch set 3 V +1 CR +1 12/12/22, 20:26

  14. Benjamin Franzke commented on patch set 3 V -1 12/12/22, 21:46

    Leads to Too few arguments to function TYPO3\CMS\Backend\Routing\Router::__construct(), 0 passed in /var/www/html/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 2993 and exactly 1 expected in Environment Status, because Backend Router is currenlty not instantiatable in installtool context since https://review.typo3.org/c/Packages/TYPO3.CMS/+/76865
  15. Benjamin Franzke uploaded patch set 4 CR +1 V +1 12/12/22, 21:55

  16. Benjamin Franzke commented on patch set 4 12/12/22, 21:55

    Reply

    Fixed by defining the missing RequestContextFactory service (already used by UriBuilder in installtool mode) and adding it to the Router-factory-fallback used in configureBackendRouter.
  17. core-ci voted on patch set 4 V +1 12/12/22, 22:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34960

  18. Benjamin Franzke voted on patch set 4 V +1 CR +1 12/12/22, 22:33

  19. Benni Mack voted on patch set 4 V +2 CR +2 12/13/22, 09:12

  20. Benni Mack merged patch set 5 12/13/22, 09:12