Skip to content

No circuit breaker for did:web resolution — one bad issuer poisons the service #22

@OkeyAmy

Description

@OkeyAmy

The Problem

When a `did:web` DID document cannot be fetched (DNS failure, HTTP timeout, malformed response), the resolver returns an error and the verification fails. This is correct. But there is no circuit breaker — every subsequent request for the same DID hits the network again.

If an issuer's `did:web` endpoint goes down, every bundle with that issuer fails, and every failure attempt burns the full HTTP timeout waiting for a response that will not come. At high request rates, this means a large fraction of the thread pool is stuck waiting on a dead endpoint.

This is distinct from the global lock issue (#10). Even after fixing the lock, without a circuit breaker, a dead `did:web` endpoint causes repeated expensive failures for every request with that issuer.

What Must Change

  1. Track failure counts per DID in the resolver. After N consecutive failures (configurable, default 5) within a window, open the circuit for that DID.
  2. While the circuit is open, return an error immediately without attempting network I/O.
  3. After a configurable cooldown period (default 60 seconds), allow one probe request through. If it succeeds, close the circuit. If it fails, extend the cooldown.
  4. Expose the circuit state as a metric or in the `/readyz` response so operators can see which DIDs are tripped.

A circuit breaker is not optional for a service that makes outbound HTTP calls in the critical verification path. Without one, a single unreachable issuer degrades the entire service for all traffic.

Severity

MEDIUM. Operational resilience issue rather than a direct security bypass. Becomes HIGH in deployments where `did:web` issuers are on external infrastructure not under your control.

Metadata

Metadata

Assignees

No one assigned

    Labels

    mediumMedium severity

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions