-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
Milestone
Description
As discovered in the mail app, the dav app registers the system users address book for the contacts manager. If any app queries this manager, all personal and system-wide contacts can be retrieved, even if sharing options are configured to not suggest any other system users.
Ref nextcloud/mail#848 (comment)
server/lib/private/ContactsManager.php
Lines 41 to 54 in 7b4e51d
| public function search($pattern, $searchProperties = array(), $options = array()) { | |
| $this->loadAddressBooks(); | |
| $result = array(); | |
| foreach($this->addressBooks as $addressBook) { | |
| $r = $addressBook->search($pattern, $searchProperties, $options); | |
| $contacts = array(); | |
| foreach($r as $c){ | |
| $c['addressbook-key'] = $addressBook->getKey(); | |
| $contacts[] = $c; | |
| } | |
| $result = array_merge($result, $contacts); | |
| } | |
| return $result; |
server/apps/dav/lib/CardDAV/ContactsManager.php
Lines 55 to 59 in 7b4e51d
| public function setupContactsProvider(IManager $cm, $userId, IURLGenerator $urlGenerator) { | |
| $addressBooks = $this->backend->getAddressBooksForUser("principals/users/$userId"); | |
| $this->register($cm, $addressBooks, $urlGenerator); | |
| $this->setupSystemContactsProvider($cm, $urlGenerator); | |
| } |
cc @rullzer