Review 12.4 Merged

87737[SECURITY] Circumvent parser deviation in PSR-7 URI object

Oliver Hader CR +2 V +2 Normal +171 −6 updated 01/14/25, 09:52

Commit message

Adapt the URI object to refuse construction based on invalid URL
inputs.

As `parse_url()` is defined to not validate the resulting parts of
the parsed URL, a parser deviation between PHP and browser URL
implementations is possible when URL parts contain invalid characters.

The missing validation is now performed via PHP upstream rules built
into `filter_var()`. Note that `filter_var` has two limitations:
It requires a fully qualified URL and it can not validate IDN domain
names that have not been converted to ascii before.
In order to circumvent these limitations we'll imply a intermediate fake
default-scheme and perform IDN-to-ascii conversion for the purpose
of the validation.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
  • Verified V +2 Done
    • Oliver Hader +2

Issues 1

Files 3

Review log 34

  1. Oliver Hader uploaded patch set 1 01/14/25, 09:46

  2. Oliver Hader commented on patch set 1 CR +2 V +2 01/14/25, 09:46

    Auto-approved
  3. Oliver Hader merged patch set 2 01/14/25, 09:46

  4. core-ci voted on patch set 1 V +1 01/14/25, 09:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72414