Make WordPress Core

Opened 6 weeks ago

Last modified 6 weeks ago

#63490 new defect (bug)

Non secure sudomain site url in site activation email

Reported by: umeshnevase's profile umesh.nevase Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.8
Component: Login and Registration Keywords: has-patch needs-testing
Focuses: Cc:

Description

I've enabled Network site settings for Both site and user registration.

After creating a subdomain and registering a new user site, I got the email requesting site activation. Both a non-secure site URL and a site activation URL are included in the email. The URL of the new site must be secure. When an email contains a non-secure URL and open in browser, an error message stating "Warning: Potential Security Risk Ahead" appears.

I've also checked for subdirectory install, the activation email also contain nonsecure url for new subdirectory site.

Are we keeping the non secure in URL on purpose? We should have handle it for subdirectory install at least by checking the main site is secure or not.

Also there are inconsistencies for http and https url in activate and signup emails.

Attachments (4)

subdomain-install.png (98.4 KB) - added by umesh.nevase 6 weeks ago.
Email for site activation for Subdomain Install
subdirectory-install.png (65.7 KB) - added by umesh.nevase 6 weeks ago.
Email for site activation for Subdirectory Install
subdirectory-welcome.png (74.4 KB) - added by umesh.nevase 6 weeks ago.
Email for subdirectory site install welcome message
subdomain-welcome.png (90.1 KB) - added by umesh.nevase 6 weeks ago.
Email for subdomain site install welcome message

Download all attachments as: .zip

Change History (8)

@umesh.nevase
6 weeks ago

Email for site activation for Subdomain Install

@umesh.nevase
6 weeks ago

Email for site activation for Subdirectory Install

@umesh.nevase
6 weeks ago

Email for subdirectory site install welcome message

@umesh.nevase
6 weeks ago

Email for subdomain site install welcome message

#1 @rollybueno
6 weeks ago

Looks like this depends on home settings value. e.g. https://i.imgur.com/IoiPE0t.png

On the subdomain install, the URL is fetched by using get_blogaddress_by_id():
https://core.trac.wordpress.org/browser/tags/6.8.1/src/wp-includes/ms-blogs.php#L46. It will try to set the scheme by parsing the home value. If the scheme is empty, it will be using http although it will esc_url() on the return value.

I could be wrong, but can you confirm on your settings?

#2 @umesh.nevase
6 weeks ago

I've checked some code and the nonsecure urls are added from WordPress core.
wp-includes/ms-functions.php:972
wp-includes/ms-functions.php:1019
wp-includes/ms-functions.php:1051

This ticket was mentioned in PR #8852 on WordPress/wordpress-develop by @sukhendu2002.


6 weeks ago
#3

  • Keywords has-patch added

#4 @rollybueno
6 weeks ago

  • Keywords needs-testing added
Note: See TracTickets for help on using tickets.