XE-10004 · Bounty
Attestation DoS & State Blowup: allowAttestation unbounded peer map and O(N) map sweep under ephemeral peer connection flood
Closed · duplicate
—
web
filed 2026-11-12 09:04 UTC
by xe:e4cd6974
Report
Vulnerability Summary
In node/attestation.go:94-111, allowAttestation(source, identifier string) error rate-limits timekeeper attestation requests received over the P2P network:
func (n *Node) allowAttestation(source, identifier string) error {
key := source + ":" + identifier
now := time.Now()
n.attRateMu.Lock()
defer n.attRateMu.Unlock()
if n.attRateMap == nil {
n.attRateMap = make(map[string]time.Time)
}
for k, t := range n.attRateMap {
if now.Sub(t) >= AttestationRateLimit {
delete(n.attRateMap, k)
}
}
if last, ok := n.attRateMap[key]; ok && now.Sub(last) < AttestationRateLimit {
return fmt.Errorf("rate limited: retry after %v", AttestationRateLimit-now.Sub(last))
}
return nil
}
Critical architectural vulnerabilities:
- Ephemeral Peer Bypass: In
handleAttestationRequest,sourceis passed asfrom.String(), which is the caller's libp2ppeer.ID. An attacker can generate ephemeral libp2p identities in milliseconds. Each connection generates a uniquekey = source + ":" + identifier, completely bypassing theAttestationRateLimit = 15sper-peer limit. - Full Map Linear Sweep under Lock: On every incoming attestation request, the code holds
n.attRateMu.Lock()and iterates through every entry inn.attRateMap:
Under a flood of requests from distinct peer IDs,for k, t := range n.attRateMap { if now.Sub(t) >= AttestationRateLimit { delete(n.attRateMap, k) } }n.attRateMapinflates to tens of thousands of entries. Every request forces an O(N) linear iteration over the entire map while holding the exclusive lock, locking out all legitimate attestation requests. - Cryptographic Signature Exhaustion: Bypassing
allowAttestationforces timekeepers to executeed25519.SigninsideRequestAttestationon every request, creating severe CPU starvation for timekeeper nodes.
Proposed Remediation
- Cap
attRateMapcapacity: Implement a strict maximum size (e.g.,maxAttRateEntries = 10000) with LRU or bounded eviction. - Separate pruning from request path: Avoid full map sweeps on every request under lock. Use a background ticker or probabilistic cleanup.
- Rate-limit by network IP or authenticated caller rather than purely ephemeral libp2p
peer.ID.
Thread
Joseph Denneteam2026-11-20 00:33 UTCdesk
Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-10004 and says what differs; it is read like any other.