Review main Merged

29747[FEATURE] Add "auto" absRefPrefix option

Benni Mack CR +2 V +2 Normal +50 −1 updated 12/04/14, 21:38

Commit message

For automatic distribution configuration
like the introduction package, a dynamic
option to find out whether TYPO3 is installed
under "/" or "/mysite/" the TypoScript
option config.absRefPrefix = auto
calculates the absRefPrefix automatically.

Review

  • Code review CR +2
    • Helmut Hummel +2
    • Stefan Froemken +1
    • Benjamin Kott +1
  • Verified V +2
    • Helmut Hummel +2

Issues 1

Files 2

Review log 26

Show 1 earlier messages
  1. Wouter Wolters commented on patch set 1 CR +1 04/30/14, 13:42

    Don't forget to create a documentation issue in Forge for this feature.
  1. Mr. Jenkins commented on patch set 1 04/30/14, 14:16

  2. Soren Malling voted on patch set 1 CR +1 05/01/14, 06:52

  3. Tomas Norre Mikkelsen voted on patch set 1 CR +1 05/01/14, 08:44

  4. Steffen Müller commented on patch set 1 05/01/14, 12:05

    Did you check if this approach is protected against forged HTTP_HOST headers? Long time ago, the "auto" feature was removed from config.baseUrl to prevent possible cache poisoning attacks: http://typo3.org/teams/security/security-bulletins/typo3-core/typo3-20051114-6/ http://lists.typo3.org/pipermail/typo3-dev/2009-September/037141.html
  5. Steffen Müller commented on patch set 1 05/01/14, 12:07

  6. Benni Mack commented on patch set 1 05/03/14, 19:23

    Hey Steffen, I tried reproducing this issue, with no luck. but also, I'm not a security expert. However the TYPO3_SITE_PATH strips away the HTTP_HOST (TYPO3_REQUEST_HOST) from the string, so HTTP_HOST is never added. This means that even if I'd forge the HTTP_HOST like this, it would not work: t3 url: http://www.mywebsite.com/mysubdirectory/ a subpage: http://www.mywebsite.com/mysubdirectory/any/subpage/ forged header: HTTP_HOST: www.myevilhost.com TYPO3 would internally work with HTTP_HOST to create the getIndpEnvs then: TYPO3_REQUEST_HOST = http://www.myevilhost.com TYPO3_REQUEST_URL = http://www.myevilhost.com/mysubdirectory/any/subpage TYPO3_SITE_PATH = /mysubdirectory/ So the attack would not work, as the HTTP_HOST is not outputted at all
  7. Steffen Müller commented on patch set 1 05/04/14, 12:58

    You are right, Benni. I had overseen this. Sorry for wasting your time.
  8. Steffen Müller commented on patch set 1 V +1 CR -1 05/04/14, 13:27

    PageGenerator.php:92

    1. If config.absRefPrefix is not set, this line would lead to: PHP Notice: Undefined index: absRefPrefix I'm not sure about CGL, but personally prefer NOTICE free code. 2. casting to (string) is not neccessary: trim() always returns string
  9. Steffen Müller uploaded patch set 2 05/04/14, 13:29

  10. Steffen Müller commented on patch set 2 V +1 CR +1 05/04/14, 13:30

    patchset #2 fixes the issues mentioned inline in patchset #1
  11. Steffen Müller commented on patch set 2 05/04/14, 13:42

    Please do not merge yet: master is currently still pointing to the 6.2 branch.
  12. Mr. Jenkins commented on patch set 2 05/04/14, 21:45

  13. Dmitry Dulepov commented on patch set 2 CR -1 05/05/14, 11:44

    This will reintroduce the same problem as described in the security bulletin TYPO3-20051114-6. Another side effect is that page cached for one domain, it will have its addresses in another domain, which could lead to cross-domain permission issues (for example, for iframes) and cookie issues (in case of domains example.com and example.de).
  14. Steffen Müller commented on patch set 2 05/08/14, 09:35

    Dmitry, this patchset uses: getIndpEnv('TYPO3_SITE_PATH') the insecure baseURL implementation used: getIndpEnv('TYPO3_SITE_URL') My first thought was also, that this reintroduces TYPO3-20051114-6, but I was wrong. I assume TYPO3_SITE_PATH to be safe. Have a look at http://forge.typo3.org/projects/typo3cms-core/repository/revisions/master/entry/typo3/sysext/core/Classes/Utility/GeneralUtility.php#L3471
  15. Benni Mack commented on patch set 2 07/02/14, 13:43

    Hey Dmitry, so, are you okay with proceeding? Can you please give feedback?
  16. Benni Mack rebased onto patch set 2 08/26/14, 12:01

  17. Christian Kuhn commented on patch set 3 09/08/14, 10:44

    I understand the intention of the patch, but I'm also unsure about the security impact in this special case and can no oversee this after looking 10 minutes at getIndPEnv ... One thing: If you are sure this is OK, then please remember the required documentation ReST addition for this patch before merging.
  18. Benni Mack uploaded patch set 4 10/02/14, 18:54

  19. Stefan Froemken commented on patch set 4 CR +1 10/03/14, 00:08

    Code looks good and I hope it will work correctly in all parts of the core and related extensions like realurl
  20. Benjamin Kott voted on patch set 4 CR +1 11/12/14, 12:02

  21. Helmut Hummel commented on patch set 4 12/04/14, 14:01

    PageGenerator.php:89

    what about making the behavior of "auto" to the default setting if absRefPrefix is not configured?
  22. Benni Mack commented on patch set 4 12/04/14, 21:19

    fine with me. but is it okay to get this one in finally and then turn on absRefPrefix by default in another patch?
  23. Helmut Hummel commented on patch set 4 12/04/14, 21:37

    fine with me
  24. Helmut Hummel voted on patch set 4 CR +2 V +2 12/04/14, 21:38

  25. Helmut Hummel merged patch set 4 12/04/14, 21:38