<!-- XE-13375 · Provider advertisements are replayable and never expire: a stale or revoked ad is accepted as current · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13375>. The page is the record; this is the same page for reading.*

XE-13375 · Bounty

# Provider advertisements are replayable and never expire: a stale or revoked ad is accepted as current

Closed · duplicate
—claimed Minor
[xe#529](https://github.com/xeprotocol/xe/issues/529)
filed 2026-11-13 03:20 UTC
by AIRDROP TREASURESS

Verdict
:   Duplicate

Tier
:   —

Claimed
:   Minor

Area
:   P2P / sync

Duplicate of
:   [XE-0009](https://bounty.xe.network/XE-0009) accepted

Tracked
:   internally

Updated
:   2026-11-20 00:53 UTC

Told
:   2026-11-20 00:51 UTC

### Patches

- [xe#542](https://github.com/xeprotocol/xe/pull/542) open by tipprb
  fix(net): add timestamp freshness and expiry validation to provider advertisements (fixes #529)

### History

- [559931](https://bounty.xe.network/log/559931) 2026-11-20 00:51 UTC github.state\_pushed
- [559903](https://bounty.xe.network/log/559903) 2026-11-20 00:51 UTC github.labels
- [559587](https://bounty.xe.network/log/559587) 2026-11-20 00:51 UTC reply.mirrored
- [559063](https://bounty.xe.network/log/559063) 2026-11-20 00:50 UTC proposal.adopted
- [559062](https://bounty.xe.network/log/559062) 2026-11-20 00:50 UTC reply.sent
- [559061](https://bounty.xe.network/log/559061) 2026-11-20 00:50 UTC ticket.status new → closed
- [558171](https://bounty.xe.network/log/558171) 2026-11-20 00:49 UTC proposal.adopted
- [558170](https://bounty.xe.network/log/558170) 2026-11-20 00:49 UTC ticket.facts area
- [558169](https://bounty.xe.network/log/558169) 2026-11-20 00:49 UTC proposal.adopted
- [558168](https://bounty.xe.network/log/558168) 2026-11-20 00:49 UTC ticket.facts
- [558167](https://bounty.xe.network/log/558167) 2026-11-20 00:49 UTC proposal.adopted
- [558166](https://bounty.xe.network/log/558166) 2026-11-20 00:49 UTC ticket.facts

[Full history](https://bounty.xe.network/log?ref=XE-13375) · [JSON](https://bounty.xe.network/v1/tickets/XE-13375) · [markdown](https://bounty.xe.network/XE-13375.md)

### Report

**Suggested tier:** Low

**XE address (reward destination):** 9b663fdac108be34a3b715ef78a9f9bd878af6ef8142f388c6514918e6852dd7

## Summary

`net/gossip_validate.go`, `marketplaceValidator`, ad case (\~l.41–44): the ONLY checks on an incoming provider advertisement are (a) `ad.Signature` valid over `ad.PubKey`, and (b) timestamp not in the future (`ad.Timestamp > now+1m`). There is NO freshness check on old timestamps, NO nonce, NO expiry (30 min TTL exists in the directory, but `Advertisement` in `types/types.go` has no TTL field and the advertisement TTL is never checked in `net/gossip_validate.go`).

So a captured signed ad can be replayed later — same signature, same timestamp, still valid — including after the provider rotated its price/capacity or removed the ad entirely. An old ad is accepted as current.

## Impact

An old ad can lure a consumer into requesting a lease from a provider that no longer offers those terms (e.g. price or vCPU), causing the consumer to commit funds to a lease that won't match their expectation (though the lease's cost is re-verified by the ledger — `validateAndAddLease` recomputes `LeaseCost` from the pinned certificate, so the monetary damage is bounded; the consumer is also stuck waiting for the lease to settle or cancelling it).

Severity is Low because (a) the ad's content (price/dims) is pinned by the certificate, so a replayed ad cannot create a fraudulent lease with a different price, and (b) the consumer can cancel an unaccepted lease and get refunded.

## Steps to reproduce

Unit test against the real node code (`github.com/xeprotocol/xe`, testnet-0005, commit `89a542e`):

```
git clone https://github.com/xeprotocol/xe
cd xe
cp market-node_test.go node/
cp market-net_test.go net/
go test ./node -run TestMarket -v -count=1
go test ./net -run TestMarket -v -count=1
```

Note: `market-node_test.go` / `market-net_test.go` are NOT in the public repository — the PoC test files are attached to this issue; without them, the XE team cannot run this reproduction.

**PoC 2a — stale ad accepted** (`TestMarketAdvertisement_StaleAndReplayAccepted`, in `market-node_test.go`): feed an ad with `Timestamp` 1 hour in the past through the real `handleMarketplace`.

**Expected:** the stale ad is rejected.
**Actual (reproduced 2026-11-13):** the ad is stored and served to `RequestLease`.

```
CONFIRMED: stale advertisement (1h old) accepted and stored
```

**PoC 2b — replayed ad accepted** (`TestMarketAdvertisement_StaleAndReplayAccepted`, second half): the same signed ad is replayed later — the signature is still valid, so it is accepted again (no nonce / dedup).

**Expected:** a replayed ad is rejected.
**Actual:** accepted.

```
CONFIRMED: replayed advertisement accepted again (no nonce / dedup on ad)
```

## Root cause

`net/gossip_validate.go`, `marketplaceValidator`, ad case: no lower-bound timestamp check, no nonce, no expiry; `types/types.go`, `Advertisement` has no TTL field; the 30 min directory TTL (`net/directory.go`, `DirectoryEntry`) is never consulted by the advertisement validator.

## Suggested fix

Add a freshness window for ads (e.g. 60 s, matching the pendingOffers prune), a monotonically increasing nonce per provider, and an expiry field in `Advertisement` that is checked on ingest.

## Controls verified (same PoC files, all PASS)

- Cross-context signature reuse (ad ↔ request ↔ offer) is rejected — distinct domain tags (`xe/marketplace-advertisement/v1`, `-request/v1`, `-offer/v1`) plus different field sets (`TestMarketCrossContext_SignatureReuseRejected`).
- `TotalCost` / `Timestamp` forgery is rejected — both fields are signature-covered; only exact replays pass (`TestMarketTamper_TotalCostAndTimestampSigned`). Even a tampered cost could not create a bad lease (ledger recomputes `LeaseCost` from the pinned cert).
- Stale-price lease via a replayed offer is not reachable through the honest consumer flow: `RequestLease` generates a fresh `RequestID` per call and only accepts offers for it, and the ledger re-verifies cost against the pinned certificate.
- Directory impersonation / registration replay is neutralised (monotonicity \+ 30 min TTL, `TestMarketDir_MonotonicityRejectsOldReplay`, `market-dir_test.go`).

[market-node\_test.txt](https://github.com/user-attachments/files/34781612/market-node_test.txt)
[market-net\_test.txt](https://github.com/user-attachments/files/34781614/market-net_test.txt)
[market-dir\_test.txt](https://github.com/user-attachments/files/34781613/market-dir_test.txt)

### Thread

**Joseph Denne**team2026-11-20 00:51 UTCgithub

Thanks. This is the same finding as https://bounty.xe.network/XE-0009, 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-13375 and says what differs; it is read like any other.
