Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't reveal users mail adress by default #14959

Closed
yasuoiwakura opened this issue Apr 4, 2019 · 35 comments · Fixed by #31623
Closed

don't reveal users mail adress by default #14959

yasuoiwakura opened this issue Apr 4, 2019 · 35 comments · Fixed by #31623
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: users and groups needs info privacy stale Ticket or PR with no recent activity

Comments

@yasuoiwakura
Copy link

yasuoiwakura commented Apr 4, 2019

Steps to reproduce

  1. register as a new user
  2. after some months, explore the menu
  3. discover that your mail adress was public to ALL the other cloud users on the same server

Expected behaviour

Private data should not be revealed by default

Make public data available, protect private data.
Source:

  • hacker ethics
  • gdpr

Actual behaviour

Users mail adress is revealed to other users by default

Server configuration

LAMP, Ubuntu 18.04

Nextcloud version: 15.0.5
fresh installl since upgrade from OC failed

Where did you install Nextcloud from: Webclient

List of activated apps:
deactivated ALL Apps - same behavior

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:

```{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.REMOVED.de"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "15.0.5.3",
        "overwrite.cli.url": "https:\/\/cloud.REMOVED.de",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "pipe",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "updater.secret": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "CUSTOMSETTINGSMATTHIAS": "ab hier!!!",
        "default_language": "de",
        "default_locale": "de",
        "force_language": "de",
        "force_locale": "de",
        "mail_smtpsecure": "ssl",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***"
    }
}```

### Client configuration
**Browser:**
IE, FF, Chrome
**Operating system:**
@yasuoiwakura yasuoiwakura added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Apr 4, 2019
@violoncelloCH
Copy link
Member

what do you think @nextcloud/server-triage ?

@nickvergessen
Copy link
Member

@violoncelloCH
Copy link
Member

yes, but contacts means all other users on the same server plus trusted federation servers, doesn't it? I think that's the point of @yasuoiwakura...

@yasuoiwakura
Copy link
Author

yasuoiwakura commented Apr 23, 2019

Yes, i see no reason to assume my users would want their mail adress revealed to each other.
I mean, I cannot see any of the github user's email (not even those who wrote in the same topic) and i guess there is a good reason it is private by default

@yasuoiwakura
Copy link
Author

yasuoiwakura commented May 1, 2019

Any idea how to temporary fix or disable this leak? it is a real privacy problem for my users...

@yasuoiwakura
Copy link
Author

Updated to NC16, still same problem.

btw. this information is false, since it claims that only administrators have access to my data:

https://cloud.domain.tld/index.php/settings/user/privacy

@nickvergessen
Copy link
Member

Datas in this term are your files. The email address is also checked for sharing, so this is more of a general issue with a bigger impact on how all the things are handled and needs some more planing then a quick change on a setting

@nickvergessen
Copy link
Member

Okay I just checked again and I was wrong.
If the email is set to private, you can not find users by their email address.

So I guess it boils down to the fact, that you registered (on a public instance) where "everyone on the cloud knows each other" is not a good sensitive default.
Maybe we should add an option for that, so admins can configure this.

@nickvergessen nickvergessen added feature: users and groups and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels May 2, 2019
@nickvergessen
Copy link
Member

cc @rullzer @MorrisJobke what do you think about this?

@yasuoiwakura
Copy link
Author

yasuoiwakura commented May 2, 2019

hm my current workaround is to <!--hide--> the contact list in the upper right corner.

imho, users should indeed be able to share files with other users/groups (should be defined by admin) without seeing their email.

@skjnldsv skjnldsv added the 0. Needs triage Pending check for reproducibility or if it fits our roadmap label Jun 12, 2019
@demlak
Copy link

demlak commented Nov 20, 2019

Workaround untill next update of NC to set default mode of email to private FOR NEW USER-REGISTRATION.

Edit in lib/private/Accounts/AccountManager.php

                        self::PROPERTY_EMAIL =>
                                [
                                        'value' => $user->getEMailAddress(),
                                        'scope' => self::VISIBILITY_CONTACTS_ONLY,
                                        'verified' => self::NOT_VERIFIED,
                                ],

to

                        self::PROPERTY_EMAIL =>
                                [
                                        'value' => $user->getEMailAddress(),
                                        'scope' => self::VISIBILITY_PRIVATE,
                                        'verified' => self::NOT_VERIFIED,
                                ],

This worked in my test-environment.

But i also want to set the value for allready registered users.. so i update the value in the database "oc_accounts" via:
UPDATE oc_accounts set data = json_set(data, "$.email.scope", "private")

This was not enough. mails are still shown.. so i dumped database before and after setting an email to private mode to diff them. and the result is, that email is also set in 'oc_cards' and 'oc_cards_properties'
editing those two databases seem to be more difficult =(

any idea?

@demlak
Copy link

demlak commented Dec 10, 2019

So.. no solution to set globaly mailadress hidden for allready registered users?

@yasuoiwakura
Copy link
Author

So.. no solution to set globaly mailadress hidden for allready registered users?

issue still there and ignored in NC18.

Workaround that "hides" the problem without breaking code integrity:
activate https://github.com/juliushaertl/theming_customcss
Then goto Design => Custom CSS:

#contactsmenu{
visibility: hidden;
}

@demlak
Copy link

demlak commented Mar 1, 2020

Okay I just checked again and I was wrong.
If the email is set to private, you can not find users by their email address.

So I guess it boils down to the fact, that you registered (on a public instance) where "everyone on the cloud knows each other" is not a good sensitive default.
Maybe we should add an option for that, so admins can configure this.

Since i'm not a coder.. how difficult is it to make this an option for config.php?

@jamasi
Copy link

jamasi commented Apr 15, 2020

So.. no solution to set globaly mailadress hidden for allready registered users?

issue still there and ignored in NC18.

Workaround that "hides" the problem without breaking code integrity:
activate https://github.com/juliushaertl/theming_customcss
Then goto Design => Custom CSS:

#contactsmenu{
visibility: hidden;
}

A less intrusive approach that is not breaking the autocomplete is simply hiding the mail icon:

div#contactsmenu.openedMenu div#contactsmenu-menu.menu div.content div#contactsmenu-contacts div div.contact a.top-action {
   visibility: hidden;
}

Still this is no real solution as the email address is still disclosed in the source code of the page.

@jamasi
Copy link

jamasi commented Apr 16, 2020

After digging deep into the model view controller ajax jquery stack I found this patch to close the data leak:

In nextcloud/lib/private/Contacts/ContactsMenu/ActionFactory.php edit the function that generates the email link to only generate blank links:

        public function newEMailAction($icon, $name, $email) {
                return $this->newLinkAction($icon, '', '');
        }

EDIT: An even better patch is to edit nextcloud/lib/private/Contacts/ContactsMenu/Providers/EMailProvider.php.
Change if (empty($address)) { to if (1) { so no mailto: links are generated anymore:

        public function process(IEntry $entry) {
                $iconUrl = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/mail.svg'));
                foreach ($entry->getEMailAddresses() as $address) {
                        if (1) {
                                // Skip
                                continue;
                        }
                        $action = $this->actionFactory->newEMailAction($iconUrl, $address, $address);
                        $entry->addAction($action);
                }
        }

@tcitworld
Copy link
Member

Is this a duplicate from #6582?

@demlak
Copy link

demlak commented May 27, 2020

not duplicate but related
more duplicate of this #6578

@tcitworld
Copy link
Member

#20667 will provide a way to fix this with some config.php configuration.

@Dubidubiduu
Copy link

Dubidubiduu commented Oct 24, 2020

The #CSS hack of @jamasi didn't worked for me, for I added the last part for talk support.

div#contactsmenu.openedMenu div#contactsmenu-menu.menu div.content div#contactsmenu-contacts div div.contact a.top-action, div.popovermenu ul li a.focusable[href^="mailto:"]  {
   visibility: hidden;
}

Still hopes the fix of @tcitworld gets embedded soon.

@jamasi
Copy link

jamasi commented Oct 24, 2020

The #CSS hack of @jamasi didn't worked for me, for I added the last part for talk support.

Be aware that CSS hacks do not stop nextcloud from exposing the email addresses of the other users. instead this little patch seems to work for me: #14959 (comment)
Still a proper fix like in the mentioned PR will be most welcome. So one does not have to re-apply the patch after each update.

@PVince81
Copy link
Member

see #23172, requires adding a new option in core to hide these in the contacts menu

@szaimen szaimen changed the title users reveal their mail adress by default don't reveal users mail adress by default Jun 22, 2021
@szaimen
Copy link
Contributor

szaimen commented Jun 22, 2021

cc @nextcloud/server-triage is this feasible?

@ghost
Copy link

ghost commented Jul 22, 2021

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

@ghost ghost added the stale Ticket or PR with no recent activity label Jul 22, 2021
@ghost ghost closed this as completed Aug 5, 2021
@Moini
Copy link

Moini commented Sep 30, 2021

I'd like this (or the duplicate bug report) to be reconsidered.
(see #9638 (comment))

@yasuoiwakura
Copy link
Author

I'd like this (or the duplicate bug report) to be reconsidered. (see #9638 (comment))

I really don't mean to be toxic+offtopic, but this issue is a clear reason i stopped using nextcloud and use the former product and never considered using it again :-/

@jamasi
Copy link

jamasi commented Oct 23, 2021

The issue is not fixed but made worse in Nextcloud 21.

@Moini
Copy link

Moini commented Oct 24, 2021

@szaimen I see you're able to add and remove tags here. Could you please consider removing the auto-close / stale tag? I think people just missed reacting to it.

@demlak
Copy link

demlak commented Oct 25, 2021

Ok.. this took me several hours..

intro:
besides the fact, that the mailadresses-scope should be default private (workaround here: #14959 (comment)) there is a leak also of those mailadresses, that are marked as private! this is a big fat NO GO!

Here is my solution:

  1. to hide the addresses from the contacts upper-right-corner, just comment out the EMailProdider:Class, line 88 in https://github.com/nextcloud/server/blob/stable20/lib/private/Contacts/ContactsMenu/ActionProviderStore.php
    as described here: Option to disable showing system email in avatars' contacts menu #23172
	private function getServerProviderClasses() {
		return [
		//	EMailProvider::class,
		];
}
  1. to hide EMail-Addresses from the Autocompletion in the share-dialog, assign an empty string to every
    'shareWithDisplayNameUnique' => "", in
    /lib/private/Collaboration/Collaborators/UserPlugin.php and /lib/private/Collaboration/Collaborators/MailPlugin.php

Now, the only shown mail-adresses are those, that are also shown in your contacts-app.

UserPlugin.php is responsible for Autocompletion Search-results, that starts with the Searchpattern
MailPlugin.php is responsible for Autocompletion Search-results, that have the searchpattern anwhere else..

For example:
Search pattern: ja
UserPlugin.php catches:
Janet
Janine
Janice

MailPlugin.php catches:
Kolja
Katja
Benjamin

  1. Instead of hide every mailadresse, i would like to show those, of users who set their mailadresse to be not-private..

since i don't know the syntax to get the scope-info of the email-property, i just have a "concept" of this idea.. could anyone help-out for the syntax?

$mailscope = AccountManager::PROPERTY_EMAIL['scope'];
shareWithDisplayNameUnique' => !empty($userEmail) && $mailscope !== PRIVAT ? $userEmail : $uid,

@nickvergessen please reopen this issue, since it is very general and still unfixed.

@demlak
Copy link

demlak commented Nov 9, 2021

i am a little bit confused about the no-reaction.. it would be nice to get any feedback of others with the same problem.. and/or feedback of devs about this.

i think i found a good solution that makes the mail-thingy GDPR/DSGVO-complient, where it never was.

@Dacit
Copy link

Dacit commented Nov 14, 2021

Please re-open, many people have asked this question or opened similar issues in the past.

@nickvergessen

@tschombes
Copy link

This is still an issue with the latest nextcloud version and this is a nightmare. Nextcloud is NOT useable in germany with this issue. Please add an option to disable the users email are visible by default.

@jamasi
Copy link

jamasi commented Apr 5, 2023

Still an issue for 23.0.12 at least.

@sysvwfwsw
Copy link

And still an issue on 25.0.10

@Keyinator
Copy link

Still an issue on 27.1.2

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: users and groups needs info privacy stale Ticket or PR with no recent activity
Projects
None yet