Skip to content

Fix GH-25869: UrlBuilder::setHost() accepts forbidden host code points - #25870

Open
lazerg wants to merge 2 commits into
php:PHP-8.6from
lazerg:fix/gh-25869-urlbuilder-sethost-nul
Open

lazerg wants to merge 2 commits into
php:PHP-8.6from
lazerg:fix/gh-25869-urlbuilder-sethost-nul

Conversation

@lazerg

@lazerg lazerg commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Uri\WhatWg\UrlBuilder::setHost() only rejected the /, ?, # and \ delimiters, so a host like "\0bébé.be" was accepted and the error only showed up later in build(). The other forbidden host code points (NUL, space, <, >, @, ^, |, and :, [, ] outside an IPv6 address) are invalid in both domain and opaque hosts, so setHost() now rejects them right away, like Uri\Rfc3986\UriBuilder::setHost().

Fixes #25869

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant