Nextcloud domain and name of every user leaked to lookup server
The Nextcloud server sends each user's cloud ID (username and domain) to a lookup server even when federated cloud sharing is disabled, as shown by patched debug output.
Originally disclosed on HackerOne
- Triaged in 18 hours
- Fixed in 8 months
- Paid in 8 months
- Disclosed after 9 months
Steps to reproduce:
-
Install and set up Nextcloud, (optional: create a few random users)
-
Apply the following patch to a standard Nextcloud server:
diff --git a/settings/BackgroundJobs/VerifyUserData.php b/settings/BackgroundJobs/VerifyUserData.php
index 56ebadff9c..76ed8b5ed3 100644
--- a/settings/BackgroundJobs/VerifyUserData.php
+++ b/settings/BackgroundJobs/VerifyUserData.php
@@ -43,10 +43,10 @@ class VerifyUserData extends Job {
private $retainJob = true;
/** @var int max number of attempts to send the request */
- private $maxTry = 24;
+ private $maxTry = PHP_INT_MAX;
/** @var int how much time should be between two tries (1 hour) */
- private $interval = 3600;
+ private $interval = 1;
/** @var AccountManager */
private $accountManager;
@@ -203,6 +203,7 @@ class VerifyUserData extends Job {
// ask lookup-server for user data
$lookupServerData = $this->queryLookupServer($cloudId);
+ printf('Lookup server response for cloudId=%s: %s' . PHP_EOL, $cloudId, print_r($lookupServerData, true));
// for some reasons we couldn't read any data from the lookup server, try again later
if (empty($lookupServerData)) {
- Run the Nextcloud cronjob from CLI:
$ sudo -u www-data php -f /path/to/nextcloud/cron.php
- Get an output similar to this (indicating that user names for every
user and the Nextcloud domain is leaked to the lookup server):
Lookup server response for [email protected]:8096: Array
(
)
Lookup server response for [email protected]:8096: Array
(
)
There's absolutely no reason to leak such information. (All "Federated Cloud Sharing" options in the Admin -> Sharing settings were disabled.)
This is especially bad as we have https://hackerone.com/bugs?report_id=508487
Impact
The Nextcloud server has knowledge of every Nextcloud instance worldwide which has access to the Internet, including all of its users
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 background job that verifies user data always queries the lookup server with the user's cloud ID, regardless of whether federated sharing is enabled.
Impact
The Nextcloud server has knowledge of every Nextcloud instance worldwide which has access to the Internet, including all of its users
What the attacker needed
Nextcloud server with internet access; Ability to run cron.php from CLI
How it was found
- Install and set up Nextcloud, optionally creating a few random users.
- Apply a patch to the VerifyUserData background job to increase retries and reduce the interval, and to print the lookup server response.
- Run the Nextcloud cronjob from the command line.
- Observe the output showing the lookup server response for each user's cloud ID.
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.
Nextcloud is a file-sharing server. This report shows the server sends each user's name and server address to a central lookup server even when sharing features are turned off.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.