Skip to content
Info disclosure Disclosed report Intermediate CVE-2023-23944

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

During the setup of a Gmail XOAUTH2 account in the Nextcloud Mail app, the password entered by the user is stored in cleartext in the database until the OAuth2 setup completes. A database administrator could read this plaintext password.

christophwurst Follow

Originally disclosed on HackerOne

  • Triaged in under an hour
  • Fixed in 49 days
  • Disclosed after 3 months

Summary by the program

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

The report

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

The original report as published on HackerOne, by christophwurst. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

A database administrator could read the plaintext password.

What the attacker needed

Admin configures Gmail OAuth client; attacker has database access

How it was found

  1. Configure Gmail OAuth client ID and secret as Nextcloud admin
  2. Open the Mail app and go to the setup page
  3. Enter a display name, a random password, and the Gmail address
  4. Continue the setup until the Gmail consent popup appears
  5. Inspect the oc_mail_accounts table; the inbound_password and outbound_password fields contain the random password in cleartext

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you set up an email account, you type a password. Normally the app scrambles (encrypts) it before saving. Here, for a short time during setup, the password is saved as plain text, so anyone who can look at the database can read it.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by christophwurst

View all

3 more disclosed reports, best first.

More from Nextcloud

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.