91557[BUGFIX] Prevent decoding of user supplied URLs in LinkBrowser
Commit message
Review
-
Code review CR +2 Done
- Benjamin Franzke +2
- Garvin Hicking +1
-
Verified V +2 Done
- Benjamin Franzke +2
- Garvin Hicking +1
- core-ci +1 CI
Issues 2
Files 2
Review log 1014
-
Andreas Nedbal uploaded patch set 1 11/11/25, 14:50
-
Andreas Nedbal updated the commit message in patch set 2 11/11/25, 14:51
-
core-ci voted on patch set 1 V +1 11/11/25, 15:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89017
-
core-ci voted on patch set 2 V +1 11/11/25, 15:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89018
-
Andreas Nedbal uploaded patch set 3
V +111/11/25, 15:22 -
core-ci voted on patch set 3 V +1 11/11/25, 15:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89029
-
Garvin Hicking voted on patch set 3 CR +1 V +1 11/11/25, 20:57
-
Benjamin Franzke commented on patch set 3 CR -1 11/12/25, 09:19
Btw, I just noticed that the issue reports about two problems: encoding being decoded and " being escaped. If an non encoded URL is used, like: ``` https://example.org/page?query={"foo":["bar"]} ``` Then it is good that the handler does not automagically applies encoding, but tries to preserve the characters as-is, but it still applies `\` to the `"` symbols, that means the result is not preserved: ``` https://example.org/page?query={\"foo\":[\"bar\"]} ``` I guess that's a link browser issue, but I think worth investigating?form-engine-link-browser-adapter.ts:74We talked about this yesterday and I think this is a good fix to counter the destructive `decodeURI` in ajax InputTransformer. But, reading https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI again, there's a sentence that makes me doubt: > Compared to encodeURIComponent(), this function encodes fewer characters, preserving those that are part of the URI syntax. > > encodeURI() escapes all characters except: > `A–Z a–z 0–9 - _ . ! ~ * ' ( )` > `; / ? : @ & = + $ , #` > The characters on the second line are characters that may be part of the URI syntax, and are only escaped by encodeURIComponent(). So `encodeURI` is meant for complete URLs and applies some heuristics therefore does not encode values that are part of an url, I mean, InputTransformer uses decodeURI, but is there is chance that characters are altered anyway? In other words, I'm not sure whether `(input: string): string => decodeURI(encodeURI(input))` is 100% idempotent. -1 for now, we need to double check this, or better create an own `URLSearchParams` object, which should be safer. -
Benjamin Franzke uploaded patch set 4
CR +1V +111/12/25, 11:02 -
Benjamin Franzke commented on patch set 4 CR +1 V +1 11/12/25, 11:09
Reply
Will be handled separately.form-engine-link-browser-adapter.ts:74ReplyDone -
core-ci voted on patch set 4 V +1 11/12/25, 11:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89265
-
Garvin Hicking voted on patch set 4 CR +1 V +1 11/13/25, 11:09
-
Benjamin Franzke voted on patch set 4 CR +2 V +2 11/13/25, 11:51
-
Benjamin Franzke merged patch set 5 11/13/25, 11:54