Skip to content
Crypto Disclosed report Intermediate CVE-2020-8183

The password of a mail share is not hashed if the password is given when the share is created

When a mail share is created with a password supplied by the caller, the password is stored in the database in plain text rather than being hashed. An attacker who can read the database could therefore obtain the plain-text password of such shares.

daniel_calvino_sanchez Follow

Originally disclosed on HackerOne

  • Triaged in under an hour
  • Fixed in 11 days
  • Disclosed after 5 months
  • Create a new mail share with a password by using the OCS endpoint with something like:

curl -u admin:admin -X POST -H "OCS-APIRequest: true" "http://localhost/ocs/v1.php/apps/files_sharing/api/v1/shares?path=welcome.txt&shareType=4&[email protected]&password=plainTextPassword"

  • Check the last item in the "oc_share" table in the database; the stored password is "plainTextPassword" instead of a hashed version.

Note that the password is properly hashed if the password is autogenerated (https://github.com/nextcloud/server/blob/caff1023ea72bb2ea94130e18a2a6e2ccf819e5f/apps/sharebymail/lib/ShareByMailProvider.php#L236) or if the share is later updated with another password (https://github.com/nextcloud/server/blob/16da29caba1cefa4c0762fae6014d6d2c737ee94/lib/private/Share20/Manager.php#L1085).

Impact

An attacker would be able to get the plain text password of a mail share.

The original report as published on HackerOne, by daniel_calvino_sanchez. 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

An attacker with access to the database could read the plain-text password of a mail share.

What the attacker needed

Access to the database; ability to create a mail share with a password

How it was found

  1. Create a new mail share with a password through the OCS sharing endpoint.
  2. Inspect the last row of the share table in the database.
  3. Observe that the stored password is the plain-text value rather than a hash.

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.

A mail share is a way to share a file with someone by sending them a link and a password. Normally the server should scramble (hash) that password before saving it, so nobody can read it back. Here the server saved it as-is, so anyone who can look inside the database can read the password directly.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More by daniel_calvino_sanchez

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.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.