Skip to content

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

Open
crazytonyli wants to merge 3 commits into
trunkfrom
task/selfhosted-http-signin-warning
Open

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

Conversation

@crazytonyli

@crazytonyli crazytonyli commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Two main changes:

  • The self-hosted sign in flow now presents an "insecure connection" warning when attempting to add a non-https site.
  • The ApplicationPasswordRepository, which creates and validates application passwords, now only work with HTTPS url.

@wpmobilebot

wpmobilebot commented Aug 5, 2026

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 Number34003
VersionPR #25870
Bundle IDorg.wordpress.alpha
Commit6f65a56
Installation URL2eflm6fnm1df0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Aug 5, 2026

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 Number34003
VersionPR #25870
Bundle IDcom.jetpack.alpha
Commit6f65a56
Installation URL1vrhq63udrq8g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@crazytonyli
crazytonyli force-pushed the fix/xmlrpc-https-downgrade branch from 8cf3c89 to edd751d Compare August 11, 2026 05:08
Base automatically changed from fix/xmlrpc-https-downgrade to release/27.2 August 19, 2026 23:04
@crazytonyli
crazytonyli force-pushed the task/selfhosted-http-signin-warning branch 2 times, most recently from 8b44c1b to 97e628f Compare August 26, 2026 02:43
@crazytonyli
crazytonyli changed the base branch from release/27.2 to trunk August 26, 2026 02:43
@crazytonyli
crazytonyli force-pushed the task/selfhosted-http-signin-warning branch from 97e628f to 1af1131 Compare August 26, 2026 06:48
@crazytonyli
crazytonyli marked this pull request as ready for review August 26, 2026 06:48
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. Each path checks the
destinations it contacts and throws insecureConnection for an insecure
one: validation (the site URL and stored REST root) is checked in
validatePasswords before any request, and self-hosted password creation
(login_url, admin_url, and the wp-json base, all derived from xmlrpc and
independently http-capable) is checked before creating. Jetpack sites
create through the WordPress.com proxy over https and are not gated on the
site's own scheme, so an https site with a valid token but a legacy http
xmlrpc is not blocked.

The REST API root resolved by discovery is validated before it is
persisted to Blog.restApiRootURL, so an insecure value is never stored
where other consumers could later send credentials to it. Getting an
application password for an insecure site instead goes through the
interactive sign-in flow, which shows the insecure-connection warning;
existing repository callers already catch the error and degrade
gracefully.
@crazytonyli
crazytonyli force-pushed the task/selfhosted-http-signin-warning branch from 1af1131 to 6f65a56 Compare August 26, 2026 06:48
@crazytonyli
crazytonyli requested a review from jkmassel August 26, 2026 06:50
@crazytonyli crazytonyli added this to the 27.3 milestone Aug 26, 2026
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.

2 participants