{"id":"XE-0623","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":242,"title":"[Node/P2P] CertificateHash[:12] slice without bounds check panics node on crafted lease_accept — core/ledger.go:1692","area":"leasing-ledger","claimed_tier":"medium","assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":null,"status":"triaging","closed_reason":null,"github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-05T07:18:48.025867+00:00","updated_at":"2026-11-08T20:48:07.692861+00:00","source_created_at":null,"told_at":"2026-11-08T20:48:07.700127+00:00","status_changed_at":"2026-11-08T20:48:01.766647+00:00","url":"https://bounty.xe.network/XE-0623","body":"## Summary\n`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.\n\n## Affected Code\n`core/ledger.go:1692` — inside the lease accept/settle handler:\n```go\nhash := cert.CertificateHash[:12]\n```\n\nNo 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.\n\n## Reproduction\n1. Run a local XE node (genesis or testnet join).\n2. Craft a `lease_accept` message with `CertificateHash` set to a short byte slice (e.g., 4 bytes instead of the expected 32-byte hash).\n3. Send it to the node's P2P port.\n4. The node panics and terminates.\n\n## Impact\nNetwork-triggerable denial of service: any peer on the network can crash a node. In a network with open peering (testnet), this is trivially exploitable.\n\n## Severity\nMedium — node crash, network-reachable, no privilege required, no data loss beyond the process termination.\n\n## Fix\nAdd a length check before the slice:\n```go\nif len(cert.CertificateHash) < 12 {\n    return fmt.Errorf(\"certificate hash too short: %d bytes\", len(cert.CertificateHash))\n}\nhash := cert.CertificateHash[:12]\n```","patch_refs":[],"thread":[{"id":1238,"source":"desk","source_ref":"reply:779","author":"Joseph Denne","team":true,"body":"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.","created_at":"2026-11-08T20:48:07.692861+00:00"}]}