Skip to content

ext/standard: http(s) wrapper corrupts the basic auth header on perce… - #22172

Closed
devnexen wants to merge 2 commits into
php:PHP-8.5from
devnexen:gh22171
Closed

ext/standard: http(s) wrapper corrupts the basic auth header on perce…#22172
devnexen wants to merge 2 commits into
php:PHP-8.5from
devnexen:gh22171

Conversation

@devnexen

Copy link
Copy Markdown
Member

…nt-encoded userinfo.

php_url_decode() returns the shorter decoded length but ZSTR_LEN() is left untouched, so smart_str_append() carries the stale [decoded][NUL][undecoded tail] bytes into the base64 credentials.

Fix#22171

…nt-encoded userinfo.
php_url_decode() returns the shorter decoded length but ZSTR_LEN() is left
untouched, so smart_str_append() carries the stale [decoded][NUL][undecoded
tail] bytes into the base64 credentials.
Fixphp#22171
@devnexen

Copy link
Copy Markdown
MemberAuthor

the ftp wrapper, however, does it correctly.

@devnexen
devnexen marked this pull request as ready for review May 28, 2026 18:41
@devnexen
devnexen requested a review from bukka as a code ownerMay 28, 2026 18:41
@devnexendevnexen linked an issue May 28, 2026 that may be closed by this pull request

@iluuu1994iluuu1994 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise.

Comment threadext/standard/tests/http/gh22171.phpt Outdated
Comment threadext/standard/tests/http/gh22171.phpt Outdated
Comment threadext/standard/tests/http/gh22171.phpt Outdated

@iluuu1994iluuu1994 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

wheakerd pushed a commit to wheakerd/php-src that referenced this pull request May 29, 2026
…nt-encoded userinfo.
php_url_decode() returns the shorter decoded length but ZSTR_LEN() is left
untouched, so smart_str_append() carries the stale [decoded][NUL][undecoded
tail] bytes into the base64 credentials.
Fixphp#22171closephpGH-22172
@devnexen
devnexen deleted the gh22171 branch August 23, 2026 14:26
Sign up for freeto 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.

Invalid auth header generation in http(s) stream wrapper

2 participants

@devnexen@iluuu1994