diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index 77e17b3f8b877..520902cdd64ba 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -126,7 +126,12 @@ function wp_populate_basic_auth_from_authorization_header() { $token = substr( $header, 6 ); $userpass = base64_decode( $token ); - list( $user, $pass ) = explode( ':', $userpass ); + // There must be at least one colon in the string. + if ( ! str_contains( $userpass, ':' ) ) { + return; + } + + list( $user, $pass ) = explode( ':', $userpass, 2 ); // Now shove them in the proper keys where we're expecting later on. $_SERVER['PHP_AUTH_USER'] = $user;