{"id":"XE-7915","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":1790,"title":"core/ledger: LeaseAccept rejects every accept for a zero-expiry certificate while Lease accepts it - missing != 0 guard desyncs lease/accept expiry checks","area":"leasing-ledger","claimed_tier":"minor","assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-11T19:20:16.880510+00:00","updated_at":"2026-11-17T09:38:15.130318+00:00","source_created_at":null,"told_at":"2026-11-17T09:38:15.159641+00:00","status_changed_at":"2026-11-17T09:38:15.149626+00:00","url":"https://bounty.xe.network/XE-7915","body":"## Summary\r\n\r\nA provider-signed performance certificate with `ExpiresAt == 0` passes content verification and gossip ingest, which perform no expiry check at all, and passes the lease-side expiry check, which guards `cert.ExpiresAt != 0`. But `validateAndAddLeaseAccept` checks `startTime > certInfo.ExpiresAt` with no such guard, so every accept for that provider always fails with `certificate expired` (startTime is ~1.7e18 ns). The provider's leases can be created but never accepted, stranding consumer escrow until cancel. The fix is the same `!= 0` guard its two sibling validators already have.\r\n\r\n## Impact\r\n\r\n- A provider whose certificate carries `ExpiresAt == 0` can have leases created against it, but no `LeaseAccept` for that provider can ever succeed. Consumer escrow is locked until the lease is cancelled.\r\n- Severity is low in practice: a node issuing its own certificate always fills a real expiry (`ExpiresAt = startMedian + CertificateValidity`, 7 days), so triggering this requires a provider deliberately signing a malformed certificate for its own identity. The bug is a validation desync, not an attacker primitive — but it is a permanent denial of acceptance for the affected provider, and the inconsistency between the three sibling checks is exactly the kind of gap that hides worse desyncs.\r\n\r\n## Reproduction (in-process test)\r\n\r\n`store/zz_cert_expiry_test.go`, `TestZZCertExpiryZero` (commit 89a542e):\r\n\r\n- A zero-expiry certificate (hash `1485b43d55f3`) passes `VerifyCertificateContent`.\r\n- A lease against it (`77e6449b9fae`) is created successfully.\r\n- The accept for that lease fails with `lease_accept: certificate expired`.\r\n- Control: the same blocks with `ExpiresAt = now + 7 days` pass the expiry check and fail later at `locked_r must be set`, as expected — proving the expiry value is the only difference.\r\n\r\nTest output (also attached as a screenshot):\r\n\r\n```\r\nzero-expiry cert passes VerifyCertificateContent (hash 1485b43d55f3)\r\nlease created OK against zero-expiry cert (hash 77e6449b9fae)\r\naccept correctly fails at expiry check: lease_accept: certificate expired\r\ncontrol accept passes expiry, fails later as expected: lease_accept missing locked emission params: locked_r must be set\r\n```\r\n\r\n## Root cause (code)\r\n\r\n- `core/ledger.go:1697` (`validateAndAddLeaseAccept`): `if startTime > certInfo.ExpiresAt` — no `!= 0` guard.\r\n- `core/ledger.go:1543` (lease side): `if cert.ExpiresAt != 0 && b.Timestamp > cert.ExpiresAt` — guard present.\r\n- `core/lease_renew.go:79` (renew side): `if cert.ExpiresAt != 0 && renewTime > cert.ExpiresAt` — guard present.\r\n- `perf/certificate.go:156-197` (`VerifyCertificateContent`): checks hash, signature, score, version, puzzles, cpu_hash, multiplier — no expiry check.\r\n- `node/perf.go:338-352` (`ingestCertificate`): only calls `VerifyCertificateContent`, no expiry check.\r\n- `node/perf.go:104`: a node issuing a certificate always sets a real expiry, which is why this needs a deliberately malformed self-signed certificate to trigger.\r\n\r\n## Relationship to known tickets\r\n\r\n- XE-0001 §2 discusses the opposite direction (ExpiresAt = MaxInt64, a certificate that never expires, favoring the provider; its fix caps the expiry window from above) — not this finding.\r\n- XE-4975 (work_proof / cpu_hash never recomputed, forged scores) is a different path.\r\n- No match was found in the visible portion of the public board for `ExpiresAt` or `certificate expired`. The duplicate check is partial (about 300 of ~757 open tickets are visible), so I leave the duplicate decision to triage.\r\n\r\n## Suggested fix\r\n\r\nAdd the `cert.ExpiresAt != 0` guard to the accept-side check in `validateAndAddLeaseAccept`, matching the lease and renew validators. Optionally, reject `ExpiresAt == 0` at certificate issuance/ingest as well, so a zero-expiry certificate cannot enter the system at all.\r\n\r\n## Environment\r\n\r\n- Commit: 89a542e (\"release: testnet-0005 quorum withhold fix\", 2026-11-10)\r\n- Evidence is an in-process test on that commit; no public testnet nodes were involved.\r\n- Attachments: screenshot of the passing test output.","patch_refs":[],"thread":[{"id":9680,"source":"desk","source_ref":"reply:8118","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-7915 and says what differs; it is read like any other.","created_at":"2026-11-17T09:38:15.130318+00:00"}]}