Skip to content

Fix GH-24315: Harden SoapClient cross-origin redirect handling - #434

Closed
iliaal wants to merge 1 commit into
masterfrom
fix/gh-24315-soap-cross-origin-redirect
Closed

iliaal wants to merge 1 commit into
masterfrom
fix/gh-24315-soap-cross-origin-redirect

Conversation

@iliaal

@iliaal iliaal commented Oct 14, 2026

Copy link
Copy Markdown
Owner

SoapClient followed any Location header and resent the HTTP authentication credentials, the stream context headers, and the SOAP envelope to whatever origin it named. Redirects to a different scheme, host, or port now fail with a SoapFault, except a same-host upgrade from http to https on port 443.

The issue notes that stripping credentials would still forward the envelope, so this rejects the redirect instead. That is stricter than the http stream wrapper used for WSDL fetches, which strips Authorization and Cookie on a cross-origin redirect (5af9465) and also counts http to https as cross-origin. Master only, since it changes behavior; UPGRADING carries the note.

Fixes php#24315

@iliaal
iliaal force-pushed the fix/gh-24315-soap-cross-origin-redirect branch 2 times, most recently from cd8e787 to 1be1612 Compare October 14, 2026 11:52
SoapClient followed any Location header, so a redirect to another host,
port, or scheme resent the HTTP authentication credentials, the stream
context headers, and the SOAP envelope to that origin. Such redirects now
fail with a SoapFault. A same-host upgrade from http to https on port 443
is still followed. The new follow_cross_origin_redirects option restores
the previous behavior. Cookies were already scoped by domain and
Proxy-Authorization only reaches the proxy, so neither changes.

Fixes phpGH-24315
@iliaal
iliaal force-pushed the fix/gh-24315-soap-cross-origin-redirect branch from 1be1612 to 79f3773 Compare October 14, 2026 13:12
@iliaal

iliaal commented Oct 14, 2026

Copy link
Copy Markdown
Owner Author

Submitted upstream as php#24329.

@iliaal iliaal closed this Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harden SoapClient cross-origin redirect handling

1 participant