Skip to content

Self Cross Site Scripting (XSS) in /forgot_password

Moderate
rhukster published GHSA-xcr8-cc2j-62fc Jun 14, 2023

Package

Login Plugin (Grav)

Affected versions

v3.7.3

Patched versions

None

Description

Summary

The "/forgot_password" page has a self-reflected XSS vulnerability that can be exploited by injecting a script into the "email" parameter of the request. While this vulnerability can potentially allow an attacker to execute arbitrary code on the user's browser, the impact is limited as it requires user interaction to trigger the vulnerability. Server-side validation should still be implemented to prevent this vulnerability.

Details

The reflected XSS vulnerability is present in the "/forgot_password" page of the web application. This vulnerability occurs when the application fails to properly sanitize user input before displaying it back to the user. An attacker can exploit this vulnerability by injecting malicious code (such as a script) into the input field on the "/forgot_password" page. When the user submits the form, the injected code is returned in the response (in notice message that user with this username does not exists) and executed on the user's browser.

PoC

To demonstrate the vulnerability, you can perform the following steps:

  1. Intercept the POST request sent by the "/forgot_password" page using a tool like Burp Suite.
  2. Modify the value of the "email" parameter in the request to the following payload: <script>alert("XSS");</script>
  3. Forward the modified request to the server.
  4. The injected script should be returned in the response and executed on the user's browser.

Impact

The impact of this vulnerability is limited, as it requires user interaction to trigger the vulnerability. While an attacker can potentially execute arbitrary code on the user's browser, the impact of the vulnerability depends on the context in which it is exploited and the level of access that the attacker gains as a result. It is still recommended to fix this vulnerability as soon as possible to prevent any potential exploitation. Since client-side validation can be bypassed, server-side validation should be implemented to properly sanitize user input before using it in the application.

Edit:
The problem may have occurred somewhere during the handling of the mail during translation:
./classes/Controller.php: $messages->add($language->translate(['PLUGIN_LOGIN.FORGOT_USERNAME_DOES_NOT_EXIST', $email]), 'error');

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

CVE ID

CVE-2023-34452

Weaknesses

Credits