Repository navigation
Description
gl clone runs the Option B3 Arweave recovery path unconditionally whenever a local keypair loads
(crates/gl/src/clone.rs, in run), against the default arweave.net and dweb.link gateways. It
is not behind a flag and does not wait for the node path to fail.
That path trusts any manifest it finds. Discovery filters transactions on three publisher-set tags
only, App-Name, Schema, and Repo, with no owners: argument. Nothing downstream compensates:
the node writes owner_did and node_did into the manifest body and as tags, but gl's Manifest
struct declares only timestamp and blobs, so those fields are never read. There is no signature
over the manifest.
The per-oid winner is then chosen by merge_manifests, which compares the tuple
(timestamp, height_rank, cid). Rust compares tuples left to right, so the manifest's own
timestamp field decides first, and that field is part of the JSON body the publisher uploaded.
Arweave block height, the one value a publisher cannot forge, is only consulted on an exact string
tie. A manifest stamped 9999-01-01T00:00:00Z therefore outranks every honest one, whatever page it
arrives on.
Filtering on the Owner-DID tag would not fix this, since tags are publisher-set too. The real
options are the Arweave transaction owner address (the owners: GraphQL filter) or a node signature
over the manifest body.
Impact
Persistent, silent denial of B3 recovery. One transaction, naming a real withheld oid with a
bogus CID, displaces the honest CID in the merged map, which holds exactly one CID per oid. The loop
fetches the bogus CID, the envelope fails to open, and the iteration continues with no warning. The
honest CID is never tried. Arweave is permanent and the attack needs no keys and no repo
relationship, so recovery for that oid silently never happens again, for every client. This defeats
B3 in exactly the total-node-loss scenario it exists for.
Unbounded work per clone. MAX_PAGES and MAX_TX_IDS bound discovery at 10,000 transactions,
but nothing bounds a manifest body or the merged map. The body is deserialized whole with no size
cap, blobs is an unbounded Vec, and the recovery loop does a serial git cat-file -e plus a
gateway GET per entry with no cap on entries. Fabricated oids are never present locally, so the
presence check never short-circuits them. One manifest with a very large blobs array turns every
gl clone of that slug into that many serial gateway fetches; one oversized body is an OOM.
What this is NOT
It is not content substitution. The decrypted plaintext must hash to the expected oid
(if written == oid, in both recovery loops) and the recovered path set comes only from the real
cloned tree's git ls-tree -r HEAD, so placing attacker bytes at a real path needs a second preimage
on an existing tree oid. Read the impact as controlling which bytes the client FETCHES, not which
bytes it ends up with.
Relationship to #315
#315 describes this weakness in passing and deliberately scopes it out, because that issue is about
the open_blob check that would make part of this inert. They are separate: #315 owns the sliver
where attacker bytes reach hash-object -w before the oid comparison and land as a dangling loose
object. Fixing #315 does not fix this issue, and this issue is the reason #315's write primitive is
remotely reachable at all.
Worth stating plainly, because it is easy to get backwards: fixing #315 narrows that write primitive
from universal to targeted rather than removing it. seal_blob takes public verifying keys, and DIDs
are public here, so an attacker who knows a target's DID can seal arbitrary plaintext to them and
open_blob will succeed legitimately.
Not related to #26 or PR #224, which cover RefAnchor and a node-side verify endpoint; neither
touches this manifest path.
Activity