Issue Bug Closed

#22886Make menu titles in the FE htmlspecialchared by default

Oliver Klee 06/15/10, 15:21 updated 06/24/24, 06:44

Description

1. to prevent XSS (by editors who can create pages)
2. to make the FE valid

(issue imported from #M14732)

Reviews 2

Linked, but not in Forger: Change 59333

History 1921

  1. Helmut Hummel commented 01/14/11, 20:47

    Do you mean TypoScript like foo = TMENU … or something in css_styled_content.

    AFAIK everything that outputs editors content is hsc’d in css_styled_content

  2. Oliver Klee commented and changed TYPO3 Version 4.4 4.6 10/15/11, 15:57

    Steps to reproduce (on current master):

    1. Create a site that uses a normal TMENU.
    2. Create a page with the following title:
      ROFL <script>alert(1);</script>
    3. View the page in the FE

    Expected results:
    no pop-ups, the script code is visible in the menue

    actual results:
    2x the “1” popup

  3. Steffen Gebert changed target version TYPO3 Version 4.6 4.7 10/17/11, 20:06

  4. Steffen Ritter changed target version 04/23/12, 22:39

  5. Steffen Ritter commented and changed target version TYPO3 Version 4.7 6.0 05/15/12, 11:31

    This is a change of behaviour which will lead to regressions in production sites, therefore I would like to only see that one in master

  6. Helmut Hummel commented and changed project id 07/29/12, 13:17

    Moving this to the public issue tracker for discussion.

    No need to handle that in secret

  7. Mathias Schreiber changed target version Is Regression 0 01/12/15, 11:08

  8. Benni Mack changed target version 06/15/15, 18:12

  9. Gerrit Code Review changed status New Under Review 06/15/15, 18:34 Patch set 1 for branch *master* of project *Packages/TYPO3.CMS* has been pushed to the review server. It is available at http://review.typo3.org/40260

  10. Benni Mack changed status Under Review New 06/30/15, 00:08

  11. Susanne Moog changed target version 08/05/15, 10:31

  12. Benni Mack changed assigned to Benni Mack target version 09/24/15, 20:06

  13. Riccardo De Contardi changed category 12/06/15, 11:31

  14. Benni Mack changed target version 03/30/17, 14:40

  15. Susanne Moog changed category 10/27/17, 13:13

  16. Riccardo De Contardi commented 06/28/18, 23:03

    just a note: this issue affects only menus built with HMENU/TMENU; if the menu is built via menuProcessor, it is not present.

  17. Georg Ringer changed assigned to Georg Ringer 01/04/19, 20:19

  18. Gerrit Code Review pushed patch set 1 for master to change 59333 status New Under Review 01/04/19, 20:52

  19. Susanne Moog commented and changed status Under Review Accepted 03/01/19, 18:32

    Review not found.

  20. Benni Mack commented and changed status Accepted Needs Feedback removed the assignee 06/21/24, 09:58

    Hey,

    I don’t know about this one: Right now, this happens only with TMENU in pure TypoScript – people nowadays use Fluid (with the data processor), so it’s rather a low impact compared to 14 years ago, when the ticket was opened. Thus, justifying the breaking change (for v14 only) should also be checked with the security team.

    My 2 cents: I personally use TypoScript HMENU for a Headless and adding HSC there by default isn’t the right spot IMHO, otherwise people would need to disable it. For that, I’d rather keep it as is for the time being.

  21. Torben Hansen commented and changed status Needs Feedback Closed 06/24/24, 06:44

    The TYPO3 security team discussed this topic and came to the conclusion, that the behavior should not be changed, since it is highly breaking and integrators can use stdWrap.htmlSpecialChars = 1 to prevent XSS in TypoScript generated menus. Rather than changing the code in this area, the documentation about this behavior for TMENU should be updated and possibilities to mitigate XSS in TMENU should be described. This ticket will therefore be closed now.

    I added a note on my todo list to update the TMENU documentation and to outline, that user input in TMENU is not escaped by default. Additionally, I will update all doc examples for TMENU to include stdWrap.htmlSpecialChars = 1.