Skip to content

Gossip ref-update ingest accepts events from any peer without authenticating the sender #323

Closed

Description

@beardthelion

The gossipsub Message arm in p2p::start deserializes a RefUpdateEvent and writes it, with no check tying the sender to the node_did the payload claims. The HTTP route carrying the same payload does considerably more: notify_sync (api/peers.rs) rejects when the signature keyid does not match req.node_did, rejects unknown peer DIDs, and validates the repo slug, and server.rs puts a per-IP brake on that route specifically because it reaches enqueue_sync. The p2p path has none of the four.

ValidationMode::Permissive does not help: it verifies signature, seqno, and from only when present, so omitting them skips verification. Switching to Strict would not fix this either, because a gossipsub signature binds a libp2p PeerId, never the node_did inside the JSON payload.

Two consequences. Forged push events reach the public REST and GraphQL feeds with attacker-chosen pusher_did, ref name, SHAs, and cert_id. And on a node with GITLAWB_AUTO_SYNC=true (all three Fly nodes set it), naming any publicly known peer DID makes resolve_origin_url succeed, after which the sync worker clones an attacker-chosen slug from that peer and registers a mirror.

Existing defenses that limit it, and are worth crediting: owner_did is re-derived rather than echoed, private and quarantined local repos are gated out of the feeds, and the sync worker re-validates the slug so traversal is not reachable.

Related: #96 covers the vacuous ON CONFLICT DO NOTHING on enqueue_sync. #82, #270, and #272 fixed this class on the HTTP side.

Activity

  1. added
    kind:security
    sev:high
    subsystem:attestation
    subsystem:identity
    subsystem:peers
    subsystem:replication
    subsystem:visibility
    on Aug 12, 2026
  2. added
    crate:node
    sev:critical
    and removed
    sev:high
    on Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    crate:nodekind:securitysev:criticalsubsystem:attestationsubsystem:identitysubsystem:peerssubsystem:replicationsubsystem:visibility

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions