Skip to content

Warn before self-hosted sign-in over an insecure connection - #25870

Draft
crazytonyli wants to merge 3 commits into
fix/xmlrpc-https-downgradefrom
task/selfhosted-http-signin-warning
Draft

Warn before self-hosted sign-in over an insecure connection#25870
crazytonyli wants to merge 3 commits into
fix/xmlrpc-https-downgradefrom
task/selfhosted-http-signin-warning

Conversation

@crazytonyli

Copy link
Copy Markdown
Contributor

Note

This PR will be merged after #25869.

Present a confirmation alert at the top of the authenticate choke point when any
pre-authorization credential destination (the site URL, REST API root, or
application-password authorization URL) uses non-loopback http. Cancel reuses the
existing SignInError.cancelled, and the debug launch-argument path never reaches
this gate. The alert is presented from the topmost controller because the sign-in
entry points already present the SwiftUI login flow.

When the pre-authorization flow was fully secure, coerce an unexpectedly-http
callback site URL to https, and skip the sign-in-time XML-RPC options fetch if
discovery resolves an insecure endpoint, so a site that proved secure end-to-end
never has its credentials sent over an unencrypted connection.
ApplicationPasswordRepository must never transmit credentials to a non-loopback
http destination on its own. createPasswordIfNeeded now throws a new
insecureConnection error before any network activity when any statically-known
credential destination is insecure: the site URL, the stored REST API root, the
xmlrpc-derived wp-json base, login_url, or admin_url, each of which can use http
independently of the others.

The REST API root resolved by discovery is validated before it is persisted, so
an insecure value is never written to Blog.restApiRootURL where other consumers
could later send credentials to it. Getting an application password for such a
site goes through the interactive sign-in flow, which shows the insecure-connection
warning; the existing repository callers already catch the error and degrade
gracefully.
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number33620
VersionPR #25870
Bundle IDorg.wordpress.alpha
Commit85ddadc
Installation URL1kv3jsldkcua8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number33620
VersionPR #25870
Bundle IDcom.jetpack.alpha
Commit85ddadc
Installation URL6o22d5iht2f7g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

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.

3 participants