nextcloud / nextcloud/server

[Bug]: New users are created with the federated scope by default

Open
#58,646 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 32-feedback bug feature: federation feature: profile
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

Today I have discovered that all new users are created with the federated scope by default. So, if you occasionally forget to disable federation and your cloud is open occasionally than all other users can find you just knowing the domain name. I think this is completely wrong and the scope should be local until changed.

Steps to reproduce
  1. Run sql query select * from oc_accounts where uid="test_user"; in your nc database.
  2. Observe:
| test_user | {"displayname":{"value":"Test user","scope":"v2-federated","verified":"0"},"address":{"value":"","scope":"v2-local","verified":"0"},"website":{"value":"","scope":"v2-local","verified":"0"},"email":{"value":"test@mydomain.tld","scope":"v2-federated","verified":"0"},"avatar":{"value":"","scope":"v2-federated","verified":"0"},"phone":{"value":"","scope":"v2-local","verified":"0"},"twitter":{"value":"","scope":"v2-local","verified":"0"},"fediverse":{"value":"","scope":"v2-local","verified":"0"},"organisation":{"value":"","scope":"v2-local","verified":"0"},"role":{"value":"","scope":"v2-local","verified":"0"},"headline":{"value":"","scope":"v2-local","verified":"0"},"biography":{"value":"","scope":"v2-local","verified":"0"},"profile_enabled":{"value":"0","scope":"v2-local","verified":"0"}} |

So, the displayame, email are of federated scope.

Expected behavior

The default values for the newly created users should be local. If needed, a user can make it federated or whatever.

Nextcloud Server version

32

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how new users are created and how the oc_accounts profile JSON receives its default scopes. Reproduce the issue with the SQL query shown and verify that newly created users use local scope for the affected fields; done means the expected database values are local by default.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.