From 76c824ab32db6fc30c06b3ff3d7a250564ad4369 Mon Sep 17 00:00:00 2001 From: Tim Nolte Date: Wed, 24 Mar 2021 09:42:51 -0400 Subject: [PATCH] Fixes Login Page XSS Issue (#283) - Adds escaping to the errot output message. - Adds escaping to the login button output. --- .../openid-connect-generic-login-form.php | 7 +- package-lock.json | 134 ++++++++++-------- 2 files changed, 80 insertions(+), 61 deletions(-) diff --git a/includes/openid-connect-generic-login-form.php b/includes/openid-connect-generic-login-form.php index 401b463..a64924d 100644 --- a/includes/openid-connect-generic-login-form.php +++ b/includes/openid-connect-generic-login-form.php @@ -132,7 +132,8 @@ class OpenID_Connect_Generic_Login_Form { function handle_login_page( $message ) { if ( isset( $_GET['login-error'] ) ) { - $message .= $this->make_error_output( $_GET['login-error'], $_GET['message'] ); + $error_message = ! empty( $_GET['message'] ) ? $_GET['message'] : 'Unknown error.'; + $message .= $this->make_error_output( $_GET['login-error'], $error_message ); } // Login button is appended to existing messages in case of error. @@ -158,7 +159,7 @@ class OpenID_Connect_Generic_Login_Form { ">