[Bug]: New users are created with the federated scope by default
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
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
- Run sql query
select * from oc_accounts where uid="test_user";in your nc database. - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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