Skip to content

[Bug]: Rejection of valid fediverse handles in user profile #52194

@M2Ys4U

Description

@M2Ys4U

⚠️ This issue respects the following points: ⚠️

Bug description

Commit fbef47a added a function to lib/private/Accounts/AccountManager.php, sanitizePropertyFediverse, that attempts to validate a fediverse handle using the Mastodon API, and attempts to call this API on the raw domain from the handle.

This is a flawed approach for a couple of main reasons:

  1. Mastodon is not the only fediverse software implementation, and its API is not universally adopted. This validation can fail if the user's host is using non-Mastodon software.
  2. Fediverse handles can point to instances running on another domain (or subdomain). For example, a user may have the handle alice@example.com but the instance may only be accessible at https://mastodon.example.com.

Instead, NextCloud should use the WebFinger protocol (RFC 7033) to validate that an account with the given handle exists, and that an appropriate link with rel=self and type=application/activity+json is returned in the WebFinger response body.

Steps to reproduce

  1. Navigate to user profile settings page.
  2. Enter a Mastodon handle that is valid, but where the Mastodon API is on another (sub)domain.
  3. The handle is rejected.

Expected behavior

The valid handle should be accepted.

Nextcloud Server version

30

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions