diff --git a/admin/admin-ajax.php b/admin/admin-ajax.php index 8dbc0b27b..77f68ac2b 100644 --- a/admin/admin-ajax.php +++ b/admin/admin-ajax.php @@ -7,6 +7,7 @@ // This file will output a JSON string yourls_content_type_header( 'application/json' ); yourls_no_cache_headers(); +yourls_no_frame_header(); if( !isset( $_REQUEST['action'] ) ) die(); diff --git a/includes/functions-auth.php b/includes/functions-auth.php index 303d39459..d34b3d53e 100644 --- a/includes/functions-auth.php +++ b/includes/functions-auth.php @@ -122,6 +122,12 @@ function yourls_is_valid_user() { */ function yourls_check_username_password() { global $yourls_user_passwords; + + // If login form (not API), check for nonce + if(!yourls_is_API()) { + yourls_verify_nonce('admin_login'); + } + if( isset( $yourls_user_passwords[ $_REQUEST['username'] ] ) && yourls_check_password_hash( $_REQUEST['username'], $_REQUEST['password'] ) ) { yourls_set_user( $_REQUEST['username'] ); return true; diff --git a/includes/functions-html.php b/includes/functions-html.php index 3d68c1d4e..1cb7fa6d9 100644 --- a/includes/functions-html.php +++ b/includes/functions-html.php @@ -59,6 +59,7 @@ function yourls_html_head( $context = 'index', $title = '' ) { // Force no cache for all admin pages if( yourls_is_admin() && !headers_sent() ) { yourls_no_cache_headers(); + yourls_no_frame_header(); yourls_content_type_header( yourls_apply_filter( 'html_head_content-type', 'text/html' ) ); yourls_do_action( 'admin_headers', $context, $title ); } @@ -725,6 +726,7 @@ function yourls_login_screen( $error_msg = '' ) { yourls_do_action( 'login_form_bottom' ); ?>

+