<!-- XE-0132 · XE Network Vulnerability Report · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0132>. The page is the record; this is the same page for reading.*

XE-0132 · Bounty

# XE Network Vulnerability Report

Closed · invalid
—claimed Medium
[xe#221](https://github.com/xeprotocol/xe/issues/221)
filed 2026-10-30 14:02 UTC
by toneey26

Verdict
:   Invalid

Tier
:   —

Claimed
:   Medium

Area
:   —

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-14 22:51 UTC

Told
:   2026-11-14 22:49 UTC

### Patches

- [xe#193](https://github.com/xeprotocol/xe/pull/193) open by arturbarszcz78
  fix(directory): enforce timestamp freshness skew window and add operator removal (fixes #169)
- [xe#233](https://github.com/xeprotocol/xe/pull/233) open by tipprb
  fix(directory): enforce timestamp freshness skew window and prevent future-dated TTL bypass (Fixes #221)

### History

- [209394](https://bounty.xe.network/log/209394) 2026-11-14 22:49 UTC reply.mirrored
- [209390](https://bounty.xe.network/log/209390) 2026-11-14 22:49 UTC reply.sent
- [18846](https://bounty.xe.network/log/18846) 2026-11-07 16:13 UTC github.state\_pushed
- [18845](https://bounty.xe.network/log/18845) 2026-11-07 16:13 UTC github.labels
- [18778](https://bounty.xe.network/log/18778) 2026-11-07 16:13 UTC proposal.adopted
- [18777](https://bounty.xe.network/log/18777) 2026-11-07 16:13 UTC ticket.facts
- [18776](https://bounty.xe.network/log/18776) 2026-11-07 16:13 UTC proposal.adopted
- [18775](https://bounty.xe.network/log/18775) 2026-11-07 16:13 UTC ticket.status new → closed
- [8111](https://bounty.xe.network/log/8111) 2026-11-05 14:02 UTC proposal.created
- [8110](https://bounty.xe.network/log/8110) 2026-11-05 14:02 UTC proposal.created
- [8102](https://bounty.xe.network/log/8102) 2026-11-05 14:02 UTC note.added
- [1127](https://bounty.xe.network/log/1127) 2026-10-31 10:43 UTC patch.linked

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

### Report

[future\_timestamp\_security\_test.go.txt](https://github.com/user-attachments/files/34186283/future_timestamp_security_test.go.txt)
[future\_timestamp\_test-output.log](https://github.com/user-attachments/files/34186284/future_timestamp_test-output.log)

**Title:** Future-Dated Directory Registrations Bypass TTL Expiration
**Severity:** Medium (availability / stale-record persistence)
**Target:** `github.com/xeprotocol/xe`, commit `978785929bc17a2f4ab30c383e5fc9cf4d634512`
**Testing:** Local-only static analysis and unit-test reproduction. No public node or production system was contacted.

## Summary

`directory.VerifyRegistration` accepts any non-zero signed timestamp but does not reject timestamps in the future. `directory.Directory.Lookup`, `List`, and `Prune` calculate expiration as `now - reg.Timestamp`. For a future timestamp, this value is negative, so the registration is considered fresh until the future timestamp is reached and the TTL elapses.

An attacker who controls a valid account key can submit a signed registration with a timestamp far in the future. The record can then remain active in the directory for approximately the chosen future offset plus the configured TTL, overriding later registrations with ordinary timestamps because `Register` keeps the highest timestamp.

## Affected Code

- `directory/verify.go`: validates `Timestamp == 0` only; no future-skew limit.
- `directory/directory.go:43-49`: accepts a registration when its timestamp is higher than the stored timestamp.
- `directory/directory.go:61`, `directory/directory.go:81`, `directory/directory.go:95`: expiration uses `now - reg.Timestamp`, allowing negative age values.

## Reproduction

The local test creates a valid signed registration with a timestamp 365 days in the future, registers it in a directory with a one-minute TTL, and immediately performs `Lookup`. The record is accepted and returned as valid.

Command:

```
powershell.exe -NoProfile -Command 'Set-Location "C:\Users\User\xe-audit"; & "C:\Users\User\local\go\bin\go.exe" test ./directory -run TestFutureDatedRegistrationNeverExpires -v -count=1'
```

Observed output:

```
=== RUN   TestFutureDatedRegistrationNeverExpires
    future_timestamp_security_test.go:28: future-dated registration remains valid: timestamp=1824904398773704700, now=1793368398774251600
--- PASS: TestFutureDatedRegistrationNeverExpires (0.00s)
PASS
ok      github.com/xeprotocol/xe/directory      1.004s
```

The timestamp is approximately one year ahead of `now`, yet `Lookup` returns the registration as valid despite a one-minute TTL.

## Impact

- A valid account owner can pin a directory record far beyond the intended TTL.
- A stale or malicious node endpoint can remain discoverable long after normal expiry.
- Later normal-timestamp updates may be ignored because `Register` rejects timestamps lower than the stored future timestamp.
- Service discovery can route traffic toward stale or attacker-controlled infrastructure.

The exact security impact depends on how directory records are consumed by discovery and connection code. This report does not claim unauthorized account impersonation: the registration remains signed by the account key. The confirmed issue is TTL bypass and stale-record pinning.

## Recommended Fix

1. Reject timestamps too far in the future, for example:

```
if reg.Timestamp > time.Now().Add(MaxRegistrationClockSkew).UnixNano() {
    return fmt.Errorf("timestamp too far in future")
}
```

2. Use a bounded clock-skew window, such as 5 minutes, based on network requirements.
3. Treat future timestamps as invalid in `Lookup`, `List`, and `Prune` instead of treating negative age as fresh.
4. Add regression tests for timestamps in the future and for replacement after expiry.

## Evidence Files

- `evidence/future_timestamp_security_test.go.txt`
- `evidence/future_timestamp_test-output.log`

No live exploit, public-node probing, or destructive action was performed.

### Thread

**arturbarszcz78**2026-10-30 14:46 UTCgithub

\[comment from a blocked account removed\]

**XE desk**team2026-11-14 22:49 UTCgithub

Thanks for the report. We read it against the code and could not confirm a bug in what it describes.

This report is closed as invalid. If we have missed something, file a new report that links
https://bounty.xe.network/XE-0132 and says what; it is read like any other.
