External storage app saves password for all users in the database
The External storage app stored every user's login password in a database table even when the user had not opted to save credentials in the database. A local system administrator with database and config access could decrypt any user's password.
- Triaged in 5 days
- Fixed in 9 months
- Disclosed after 10 months
External storage (files_external) app save passwords of all users to database table "oc_credentials" even when "Log-in credentials, save in database" option is not used.
It's a security risk that allow password extraction of all users.
A local system admin that has access to database and nextcloud config file could decrypt any user password.
Steps to reproduce
- Enable app "External storage support" (files_external).
- Login to nextcloud.
- User recoverable password will be saved to table "oc_credentials" at "password::logincredentials/credentials".
Expected behaviour
Don't save user password to table "oc_credentials" unless user has a mount with "Log-in credentials, save in database" option.
Actual behaviour
Passwords of all users is saved to table "oc_credentials" when files_external app is enabled.
Tested with
Nextcloud 18.0.4 + External storage 1.9.0 Nextcloud 17.0.5 + External storage 1.8.0
Impact
A local system admin could recover any user password.
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
Root cause
Likely the app saved login credentials to the oc_credentials table unconditionally on login, instead of only when a mount was configured with the 'save in database' option.
Impact
A local system administrator with access to the database and the Nextcloud config file could decrypt any user's password.
What the attacker needed
External storage app enabled; Attacker has database access; Attacker has Nextcloud config file
How it was found
- Enable the External storage support app.
- Log in to Nextcloud.
- Observe that the user's recoverable password is written to the oc_credentials table.
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 log in to a website, the site usually checks your password and then forgets it. Here, an add-on for file storage kept a copy of every user's password in its database, even for people who never asked it to remember them. Anyone who could read that database and the site's configuration file could turn those copies back into real passwords.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.