From b7a73d6a45ef391ec6b0b65f608dd4e5ce170921 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Mon, 27 Jan 2025 14:41:22 +0000 Subject: [PATCH] Security: Enable the referrer policy header on the login screen. This sets the same referrer policy of `strict-origin-when-cross-origin` that's used in the admin area to prevent a referrer being sent to other origins. This helps prevent unwanted exposure of potentially sensitive information that may be contained within the URL. The header can be disabled if necessary by removing the `wp_admin_headers` action from the `login_init` hook. Props kkmuffme, sagarlakhani, albatross10 Fixes #62273 See #42036 Built from https://develop.svn.wordpress.org/trunk@59712 git-svn-id: http://core.svn.wordpress.org/trunk@59054 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/admin-filters.php | 1 - wp-admin/includes/misc.php | 23 ----------------------- wp-includes/default-filters.php | 1 + wp-includes/functions.php | 24 ++++++++++++++++++++++++ wp-includes/version.php | 2 +- 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/wp-admin/includes/admin-filters.php b/wp-admin/includes/admin-filters.php index 587fbc25e9..6776f5898a 100644 --- a/wp-admin/includes/admin-filters.php +++ b/wp-admin/includes/admin-filters.php @@ -44,7 +44,6 @@ add_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' ); // Misc hooks. add_action( 'admin_init', 'wp_admin_headers' ); -add_action( 'login_init', 'wp_admin_headers' ); add_action( 'admin_init', 'send_frame_options_header', 10, 0 ); add_action( 'admin_head', 'wp_admin_canonical_url' ); add_action( 'admin_head', 'wp_site_icon' ); diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index 5ce34cf18d..afa36a2f2b 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -1415,29 +1415,6 @@ function wp_admin_canonical_url() {