Skip to main content
Menu
Advisories

idunno.AtProto Denial of Service when resolving a handle

GHSA-JX6R-8296-5VRVPublished Updated GitHub

Description

When resolving an AT Protocol handle over HTTP, idunno.AtProto read the /.well-known/atproto-did response into memory without limiting its size. The host serving that response is chosen by whoever owns the handle being resolved, so a malicious or compromised host could return an arbitrarily large body and exhaust the memory of the resolving application, crashing the process.

Impact

An attacker who can cause an application to resolve a handle under their control can allocate up to 2GB per concurrent resolution in that application's process, leading to OutOfMemoryException and process termination. Because handle resolution is generally triggered by untrusted input — a mention, a profile lookup, a search, a follow — and is frequently unauthenticated, this is reachable by any remote party in a typical deployment. Concurrent requests multiply the effect, so exhaustion is achievable well below the per-request ceiling.

Registering a handle on a host the attacker controls requires no privileges, and no interaction from a user of the targeted application is needed beyond it resolving the handle.

Fix

Handle resolution now implements a configurable limit on the requests it makes, which defaults to 5k. Resolution now

  • rejects the response up front when Content-Length exceeds the limit;
  • reads at most the limit plus one byte from the response stream, treating anything longer as unresolvable.

The limit is configurable through AtProtoAgentOptions.MaximumWellKnownResponseSize and a maximumWellKnownResponseSize parameter on the ResolveHandle overloads.

Workarounds

Set HttpClient.MaxResponseContentBufferSize to a small value on any HttpClient supplied to an agent or to the resolution helpers. Restricting handle resolution to an allowlist of trusted hosts also avoids the issue, though it is impractical for general-purpose clients.

Affected versions

References

GitHub · blowdart/idunno.Bluesky