From 2e249395de296b03a4be4131a7b85f2a1c6821c3 Mon Sep 17 00:00:00 2001 From: davidbaumwald Date: Wed, 3 Nov 2021 20:02:02 +0000 Subject: [PATCH] Comments: Add `noopener noreferrer` to author links in list table. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When viewing the listing of all comments, author links previously passed referrer information to untrusted URLs. This change adds `noreferrer` to each author link, as well as `noopener` to prevent the passing of information about the parent window. Props cybr, adam3128, erayalakese, andraganescu, audrasjb, joedolson, sabernhardt.  Fixes #40916. Built from https://develop.svn.wordpress.org/trunk@52007 git-svn-id: http://core.svn.wordpress.org/trunk@51596 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-comments-list-table.php | 7 ++++++- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/class-wp-comments-list-table.php b/wp-admin/includes/class-wp-comments-list-table.php index 2fbbbc3328..9f7a998a4d 100644 --- a/wp-admin/includes/class-wp-comments-list-table.php +++ b/wp-admin/includes/class-wp-comments-list-table.php @@ -947,7 +947,12 @@ class WP_Comments_List_Table extends WP_List_Table { echo '
'; if ( ! empty( $author_url_display ) ) { - printf( '%s
', esc_url( $author_url ), esc_html( $author_url_display ) ); + // Print link to author URL, and disallow referrer information (without using target="_blank"). + printf( + '%s
', + esc_url( $author_url ), + esc_html( $author_url_display ) + ); } if ( $this->user_can ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 01e3c1a53e..f6e20b2eef 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-52006'; +$wp_version = '5.9-alpha-52007'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.