HexBrain

Nextcloud · Report #1806275

Mail app stores cleartext password in database until OAUTH2 setup is done

Validstatus
lowseverity
12upvotes
8 Mar 2023disclosed

Summary

Security advisory at https://github.com/nextcloud/security-advisories/security/advisories/GHSA-g86r-x755-93f4

How it was found

Summary:

The Mail app usually stores the user password encrypted. For XOAUTH2 the encrypted access token is stored in the same columns. However, during the time of the setup, XOAUTH2 accounts have the password in clear text in the database.

Steps To Reproduce:

[add details for how we can reproduce the issue]

  1. Configure Gmail Oauth client ID and secret as Nextcloud admin
  2. Open the Mail app
  3. Open the setup page
  4. Enter values for display name
  5. Enter a random value for the password
  6. Enter the gmail address

-> password field hides

  1. Continue the setup

Once the Gmail consent popup shows, look into oc_mail_accounts and the last entry.

inbound_password and outbound_password have the random value entered for the password.

Supporting Material/References:

  • N/A

Impact

A DBA could read the plaintext password

This report was disclosed publicly on HackerOne and belongs to its author and the program. See the original