Clear text submission of password vulnerability

Created on 6 October 2024, 3 months ago

Problem/Motivation

Our security team has flagged a vulnerability where the password is shown in clear text in the "payload" of the login request in the network tab during user authentication on Drupal. Although Drupal stores passwords securely in a hashed format in the database, the password is exposed during transmission, which could be intercepted by a malicious party, leading to potential security breaches.

Steps to reproduce

1. Open the login page of our Drupal site.
2. Open the browser's Developer Tools and navigate to the Network tab.
3. Enter a valid username and password, then submit the login form.
4. Observe the login request payload in the network tab. The password is visible in plain text.

Proposed resolution

Implement client-side encryption of the password before it is transmitted to the server. This can be achieved using JavaScript-based encryption, such as AES, to ensure that the password is encrypted at the client side. Upon receiving the encrypted data, the server can decrypt it and proceed with normal authentication procedures.
Alternatively, enabling HTTPS with secure transmission is a minimum requirement, but this does not prevent the clear-text password from being visible in the browser's developer tools.

🐛 Bug report
Status

Active

Version

10.0

Component

user.module

Created by

🇮🇳India jay jangid Jaipur

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jay jangid
  • HTTPS is the usual approach. In what way is a plain text password a vulnerability inside a browser?

  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
  • 🇮🇳India jay jangid Jaipur

    @cilefen Thank you for your response.

    You're right that HTTPS is a critical part of secure transmission, and it ensures that data between the client and server is encrypted. However, the vulnerability I'm concerned about occurs inside the browser, before the password is transmitted.

    Even though HTTPS encrypts the communication channel, the password is still present in clear text in the browser's developer tools (specifically in the request payload). This could be a risk under certain circumstances:

    Local device compromise: If an attacker gains access to the user's device or browser session (via malware, browser vulnerabilities, or insecure environments), they could view sensitive data, including the plain-text password, in the network tab.

    Shared or public devices: In scenarios where users are logging in from shared or public computers, the password may remain exposed in the network tab, even after they close the browser.

    By implementing client-side encryption, the goal is to reduce the risk of exposing passwords in the browser before transmission. The encrypted password would only be decrypted by the server, adding an additional layer of protection in environments where HTTPS alone might not be sufficient.

    Let me know if you'd like more details or clarifications.

  • So the proposal is to use asymmetric (or symmetric?) encryption on password input with JavaScript. Do I have that right?

    If so, wouldn't the decryption key also be available in the console.

  • 🇳🇿New Zealand quietone

    Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies.

Production build 0.71.5 2024