Review main Merged

77355[BUGFIX] Avoid double hsc() in NoneElement

Christian Kuhn CR +2 V +2 Easy +0 −3 updated 01/12/23, 13:20

Commit message

TCA "type=none" with "pass_content=false" (styleguide
elements basic none_2) or without pass_content at
all (styleguide elements basic none_4) double
encodes the value. Testable using styleguide with
some DB value like "l<u>i</u>p", which needs to be
manually put into DB since none fields do not persist
data using the backend.

Note pass_content=true is documented to not hsc()
the value at all, which is not true since TYPO3 v7, a
htmlspecialchars() is still applied.

Not encoding HTML is a potential security risk, so
the patch now only fixes the "pass_content=false" and
"not set" scenario to no longer double encode, and
another patch will remove the pass_content option in v12
entirely with a TCA migration and deprecation note
stating the option did not work since 2017 anyways.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Markus Klein +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Markus Klein +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1315

  1. Christian Kuhn uploaded patch set 1 01/11/23, 15:32

  2. Markus Klein voted on patch set 1 V +1 CR +1 01/11/23, 15:35

  3. Markus Klein voted on patch set 1 V 0 CR 0 01/11/23, 15:35

  4. Markus Klein commented on patch set 1 CR -1 01/11/23, 15:35

    IMO the option should stay
  5. core-ci voted on patch set 1 V +1 01/11/23, 15:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35696

  6. Christian Kuhn commented on patch set 1 CR -1 01/11/23, 15:45

    according to docs, the hsc() below should vanish ... unsure if we should do that, maybe we should deprecate the pass_content option entirely in main at least. docs has a hint this may be a sec hole, but still ...
  7. Christian Kuhn commented on patch set 1 01/11/23, 15:56

    will abandon: we'll do that differently and will deprecate pass_content in v12.
  8. Christian Kuhn abandoned the change 01/11/23, 15:56

  9. Christian Kuhn restored the change 01/12/23, 12:25

  10. Christian Kuhn uploaded patch set 2 CR -1 V +1 01/12/23, 12:35

  11. Christian Kuhn voted on patch set 2 V +1 CR +1 01/12/23, 12:36

  12. core-ci voted on patch set 2 V +1 01/12/23, 12:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35720

  13. Markus Klein voted on patch set 2 V +1 CR +1 01/12/23, 13:17

  14. Oli Bartsch voted on patch set 2 V +2 CR +2 01/12/23, 13:19

  15. Oli Bartsch merged patch set 3 01/12/23, 13:20