Summary
Mastodon's experimental Collections feature contains an authorization flaw that lets attackers fake consent for accounts to be featured in remote Collections. By forging the FeatureAuthorization object, an attacker can make it appear that a remote account agreed to be included when it did not, under specific experimental deployments.
The issue arises from incomplete validation of the object referenced by the authorization, allowing the consent check to be bypassed in certain configurations of Mastodon's main branch or nightly builds with Collections enabled.
Affected context
The vulnerability appears in Mastodon instances that:
- Run the main branch or nightly builds, and
- Explicitly enable the experimental
Collectionsfeature via theEXPERIMENTAL_FEATURESenvironment variable, and - Participate in federated interactions where remote accounts may be featured in Collections.
It affects the logic that verifies whether a remote account has consented to be featured, when remote FeatureAuthorization objects are used to assert that consent across domains.
Exploit preconditions
- Attack surface: Federated ActivityPub endpoints handling Collections and FeatureAuthorization objects.
- Required access: Ability to publish or relay crafted ActivityPub data to a vulnerable Mastodon instance (typically via any ActivityPub-compatible server the attacker controls).
- Trigger point: Processing of a Collection item that asserts consent via a
FeatureAuthorizationobject hosted on the same domain as the featured account. - Why exploitation is possible: The implementation checks that the
FeatureAuthorizationresides on the same domain as the target object, but does not verify that the referenced object is actually the same as the object in the Collection item. This incomplete verification (CWE-345, CWE-863) allows an attacker to forge a valid-looking authorization for a different object.
Why this happens
The root cause is an incomplete authorization and integrity check around the FeatureAuthorization object used to confirm consent for being featured in a Collection. The code correctly enforces that the authorization object must live on the same domain as the account it refers to, but fails to ensure that the internal reference within the authorization matches the exact object included in the Collection entry.
This pattern maps to CWE-863: Incorrect Authorization, where the system treats a partially validated token or object as sufficient proof of permission, and CWE-345: Insufficient Verification of Data Authenticity, because it does not fully bind the authorization to the specific resource. In abstract terms, the system trusts an attestment ("this account consented") without cryptographically or semantically tying it to the concrete Collection item being processed.
Potential impact
- Remote accounts could be featured in Collections without their actual consent.
- Users and administrators may be misled about which accounts approved being highlighted, eroding trust in the platform.
- Reputation or privacy expectations of affected accounts could be undermined if they appear to endorse Collections they did not authorize.
- Federated network relationships may be strained if remote instances see their users misrepresented in Collections.
General mitigation guidance
Effective mitigation centers around strengthening authorization checks and the binding between consent and the specific resource:
- Ensure that any authorization object (such as
FeatureAuthorization) is strictly bound to the exact object it is authorizing, including verifying identifiers and canonical URIs against the Collection item. - Treat federated proof-of-consent tokens as untrusted input and perform full, context-aware validation before using them for authorization decisions.
- Design authorization artifacts to be non-reusable outside their intended scope, for example by including explicit resource identifiers, issuers, and expiry semantics.
- Apply defense-in-depth on experimental or feature-flagged capabilities by restricting their use, logging decisions, and defaulting to "no consent" when validation is ambiguous or incomplete.
- Minimize implicit trust in remote servers; require strong, explicit signals when accepting remote assertions of user consent or policy decisions.
How teams detect issues like this
Detection typically involves a mix of code- and behavior-focused approaches:
- Static analysis and code review:
- Look for authorization decisions that depend on remote or federated tokens without robust equality checks between the token's referenced object and the active resource.
- Flag logic that only checks coarse conditions (e.g., domain match) but not precise identifiers, URIs, or signatures.
- Review experimental or feature-flagged code paths where security invariants may be weaker or still evolving.
- Runtime and logging analysis:
- Instrument authorization flows to log when remote consent artifacts are accepted, including the object IDs they relate to.
- Monitor for patterns where the same
FeatureAuthorizationartifact is reused across multiple different objects or Collections. - Policy enforcement:
- Configure CI/CD pipelines to require manual security review for changes involving authorization objects or cross-instance trust decisions.
- Use automated review tools or SAST platforms with rules tuned for broken authorization patterns and insufficient identity binding.

