Index: src/wp-includes/class-walker-nav-menu.php
===================================================================
--- src/wp-includes/class-walker-nav-menu.php	(revision 39719)
+++ src/wp-includes/class-walker-nav-menu.php	(working copy)
@@ -158,6 +158,11 @@
 		$atts['rel']    = ! empty( $item->xfn )        ? $item->xfn        : '';
 		$atts['href']   = ! empty( $item->url )        ? $item->url        : '';
 
+		if( $item->target === '_blank' ){
+			$atts['rel'] .= ' noopener noreferrer';
+			$atts['rel'] = trim( $atts['rel'] );
+		}
+
 		/**
 		 * Filters the HTML attributes applied to a menu item's anchor element.
 		 *
Index: src/wp-includes/js/wplink.js
===================================================================
--- src/wp-includes/js/wplink.js	(revision 39719)
+++ src/wp-includes/js/wplink.js	(working copy)
@@ -304,7 +304,8 @@
 
 			return {
 				href: $.trim( inputs.url.val() ),
-				target: inputs.openInNewTab.prop( 'checked' ) ? '_blank' : null
+				target: inputs.openInNewTab.prop( 'checked' ) ? '_blank' : null,
+				rel: inputs.openInNewTab.prop( 'checked' ) ? 'noopener noreferrer' : null
 			};
 		},
 
