diff --git a/wp-admin/includes/class-file-upload-upgrader.php b/wp-admin/includes/class-file-upload-upgrader.php index 35baa7faeb..eb4efe7121 100644 --- a/wp-admin/includes/class-file-upload-upgrader.php +++ b/wp-admin/includes/class-file-upload-upgrader.php @@ -100,8 +100,12 @@ class File_Upload_Upgrader { if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) ) wp_die( $uploads['error'] ); - $this->filename = $_GET[$urlholder]; + $this->filename = sanitize_file_name( $_GET[ $urlholder ] ); $this->package = $uploads['basedir'] . '/' . $this->filename; + + if ( 0 !== strpos( realpath( $this->package ), realpath( $uploads['basedir'] ) ) ) { + wp_die( __( 'Please select a file' ) ); + } } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 9d64af69c1..88fde5b525 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6.1-RC1-38499'; +$wp_version = '4.6.1-RC1-38525'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.