<!-- XE-0623 · [Node/P2P] CertificateHash[:12] slice without bounds check panics node on crafted lease_accept — core/ledger.go:1692 · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0623>. The page is the record; this is the same page for reading.*

XE-0623 · Bounty

# \[Node/P2P\] CertificateHash\[:12\] slice without bounds check panics node on crafted lease\_accept — core/ledger.go:1692

Triaging
claimed Medium
web
filed 2026-11-05 07:18 UTC
by Ashev Ardiansyah

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   Medium

Area
:   Leasing / ledger

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-08 20:48 UTC

Told
:   2026-11-08 20:48 UTC

### Patches

None linked.

### History

- [45484](https://bounty.xe.network/log/45484) 2026-11-08 20:48 UTC reply.sent
- [45483](https://bounty.xe.network/log/45483) 2026-11-08 20:48 UTC proposal.adopted
- [45482](https://bounty.xe.network/log/45482) 2026-11-08 20:48 UTC proposal.adopted
- [45481](https://bounty.xe.network/log/45481) 2026-11-08 20:48 UTC ticket.status new → triaging
- [45480](https://bounty.xe.network/log/45480) 2026-11-08 20:48 UTC proposal.adopted
- [45479](https://bounty.xe.network/log/45479) 2026-11-08 20:48 UTC ticket.award
- [45478](https://bounty.xe.network/log/45478) 2026-11-08 20:48 UTC proposal.adopted
- [45477](https://bounty.xe.network/log/45477) 2026-11-08 20:48 UTC ticket.facts
- [45476](https://bounty.xe.network/log/45476) 2026-11-08 20:48 UTC proposal.adopted
- [45475](https://bounty.xe.network/log/45475) 2026-11-08 20:48 UTC ticket.facts
- [45474](https://bounty.xe.network/log/45474) 2026-11-08 20:48 UTC proposal.adopted
- [45473](https://bounty.xe.network/log/45473) 2026-11-08 20:48 UTC ticket.facts

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

### Report

## Summary

`core/ledger.go` line 1692 slices `CertificateHash[:12]` without verifying the field has at least 12 bytes. A peer that sends a `lease_accept` message with a truncated `CertificateHash` (≤11 bytes) causes the receiving node to panic with an index-out-of-range, terminating the process.

## Affected Code

`core/ledger.go:1692` — inside the lease accept/settle handler:

```
hash := cert.CertificateHash[:12]
```

No length check precedes this slice. The `CertificateHash` field is a raw `[]byte` from the wire, and a malicious or buggy peer can send any length.

## Reproduction

1. Run a local XE node (genesis or testnet join).
2. Craft a `lease_accept` message with `CertificateHash` set to a short byte slice (e.g., 4 bytes instead of the expected 32-byte hash).
3. Send it to the node's P2P port.
4. The node panics and terminates.

## Impact

Network-triggerable denial of service: any peer on the network can crash a node. In a network with open peering (testnet), this is trivially exploitable.

## Severity

Medium — node crash, network-reachable, no privilege required, no data loss beyond the process termination.

## Fix

Add a length check before the slice:

```
if len(cert.CertificateHash) < 12 {
    return fmt.Errorf("certificate hash too short: %d bytes", len(cert.CertificateHash))
}
hash := cert.CertificateHash[:12]
```

### Thread

**Joseph Denne**team2026-11-08 20:48 UTCdesk

Thanks for the report. We have read the code path you point at. The slice is unguarded, but the checks before it pin the value to a certificate hash that has already been verified on the way in, so we could not find a way for a peer to reach it with a short value. We are treating it as a small hardening item rather than a crash; https://bounty.xe.network/XE-0623 will be updated when it is addressed.
