Skip to content

Support RFC 9421 HTTP Message Signatures for incoming inbox POSTs #7

@dahlia

Description

@dahlia

Summary

Incoming ActivityPub inbox verification currently appears to handle legacy draft-cavage style HTTP Signatures, but not RFC 9421 (Signature-Input + structured Signature).

This causes valid modern senders to be marked as invalidly signed and pushed into unverified fallback processing.

Reproduction context

Using Bonfire (from source) with Hollo/Fedify sender:

  • Sender posts to inbox with RFC 9421 style headers.
  • HTTPSignatures.extract_signature/1 parses a malformed map for this format (e.g. only "headers" => ["date"], "sig1" => ":...:").
  • key lookup fails (Could not find any public key to validate).
  • valid_signature?: false, then unverified flow is used.

Representative logs from local run:

  • parsed signature map: /tmp/bonfire-server.log:92195
  • key lookup failure: /tmp/bonfire-server.log:92199
  • invalid signature decision: /tmp/bonfire-server.log:92214

Why this matters

  • Interoperability with modern implementations that prefer RFC 9421 first.
  • Reliance on fetch-based fallback is not equivalent to verified delivery, especially for non-public activities.

Proposal

Add RFC 9421 verification support alongside existing draft-cavage support:

  • parse Signature-Input and structured Signature
  • map keyid / covered components to actor-key lookup
  • validate covered components and body digest semantics used by ActivityPub senders
  • preserve backwards compatibility for legacy signature format

Acceptance criteria

  • RFC 9421-signed inbox POST validates as valid_signature?: true for compatible senders.
  • Existing draft-cavage signed requests keep passing.
  • At least one federation integration test for each signature style.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions