# Mail contact autocomplete bypasses administrator-configured user enumeration restrictions and expose member information outside the intended scope

Nextcloud Mail's contact autocomplete endpoint ignored group-restricted user enumeration settings, letting any authenticated user enumerate other groups' IDs, names, and emails.

- Payout: $250
- Severity: medium
- Program: Nextcloud
- Found by: njh215
- Disclosed: 2026-09-04
- CVE: CVE-2026-61545
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/3617729
- Library page: https://bugbountylibrary.com/r/h1%3A3617729
- Tags: area:web domain:web impact:data-leak impact:pii-leak kind:bounty platform:hackerone sev:medium tech:php technique:source-review vuln:access-control vuln:idor vuln:info-disclosure

**Target:** ContactIntegrationController::autoComplete() endpoint /apps/mail/api/contactIntegration/autoComplete/{keyword}
**Root cause:** doSearch() only checks core.shareapi_allow_share_dialog_user_enumeration and omits the stricter shareapi_restrict_user_enumeration_to_group and full-match restrictions applied elsewhere in the product.
**Steps:**
1. Enable Mail app; create groups g1/g2 with Alice in g1, Bob in g2.
2. Admin > Sharing > Privacy: check 'Restrict account name autocompletion and system address book access to users within the same groups'.
3. Login as Alice, open Mail, click New message.
4. Type `@b` in the compose textarea.
5. Observe `GET /index.php/apps/mail/api/contactIntegration/autoComplete/b` returns Bob's ID, display name, and email despite group restriction.
**How found:** Researcher compared the enumeration controls enforced in the Mail app's doSearch() against the stricter sharing privacy settings (group restriction, full-match) used elsewhere in Nextcloud, spotting the missing checks.
**Exploitation:** Any authenticated user opens the Mail compose view and types `@<partial>` to query the autocomplete endpoint, which returns directory entries from groups outside their allowed scope, disclosing user IDs, display names, and email addresses.
**Insight:** When a platform exposes multiple enumeration-restriction settings, audit each consumer endpoint for which subset it actually enforces; secondary apps often check only the master toggle and skip group/full-match restrictions.

## Proof of concept (copied exactly from the original report)

**Autocomplete request enumerating unauthorized group members**

```
GET http://nextcloud.local/index.php/apps/mail/api/contactIntegration/autoComplete/{keyword}
```

