diff --git a/src/wp-admin/menu-header.php b/src/wp-admin/menu-header.php
index 691aa9547e..ee90d23152 100644
--- a/src/wp-admin/menu-header.php
+++ b/src/wp-admin/menu-header.php
@@ -128,8 +128,9 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
if ( 'none' === $item[6] || 'div' === $item[6] ) {
$img = '
';
} elseif ( 0 === strpos( $item[6], 'data:image/svg+xml;base64,' ) ) {
- $img = '
';
- $img_style = ' style="background-image:url(\'' . esc_url( $item[6] ) . '\')"';
+ $img = '
';
+ // The value is base64-encoded data, so esc_attr() is used here instead of esc_url().
+ $img_style = ' style="background-image:url(\'' . esc_attr( $item[6] ) . '\')"';
$img_class = ' svg';
} elseif ( 0 === strpos( $item[6], 'dashicons-' ) ) {
$img = '
';