<!-- XE-16981 · [Low] xe lease renew nil-pointer panic on malformed XE_NODE · testnet -->
*Markdown view of <https://bounty.xe.network/XE-16981>. The page is the record; this is the same page for reading.*

XE-16981 · Bounty

# \[Low\] xe lease renew nil-pointer panic on malformed XE\_NODE

Closed · duplicate
—
[xe#692](https://github.com/xeprotocol/xe/issues/692)
filed 2026-11-17 08:11 UTC
by kecedanzz77-bit

Verdict
:   Duplicate

Tier
:   —

Claimed
:   —

Area
:   SDK / docs / web

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-22 23:26 UTC

Told
:   2026-11-22 23:26 UTC

### Patches

None linked.

### History

- [770088](https://bounty.xe.network/log/770088) 2026-11-22 23:26 UTC reply.mirror\_failed
- [769817](https://bounty.xe.network/log/769817) 2026-11-22 23:26 UTC proposal.adopted
- [769816](https://bounty.xe.network/log/769816) 2026-11-22 23:26 UTC reply.sent
- [769815](https://bounty.xe.network/log/769815) 2026-11-22 23:26 UTC ticket.status new → closed
- [768747](https://bounty.xe.network/log/768747) 2026-11-22 23:25 UTC proposal.adopted
- [768746](https://bounty.xe.network/log/768746) 2026-11-22 23:25 UTC ticket.facts area
- [768745](https://bounty.xe.network/log/768745) 2026-11-22 23:25 UTC proposal.adopted
- [768744](https://bounty.xe.network/log/768744) 2026-11-22 23:25 UTC ticket.facts
- [768743](https://bounty.xe.network/log/768743) 2026-11-22 23:25 UTC proposal.adopted
- [768742](https://bounty.xe.network/log/768742) 2026-11-22 23:25 UTC ticket.facts
- [766697](https://bounty.xe.network/log/766697) 2026-11-22 23:18 UTC note.added
- [766695](https://bounty.xe.network/log/766695) 2026-11-22 23:18 UTC proposal.created

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

### Report

## Summary

`xe lease renew` panics with a nil-pointer dereference when `XE_NODE` is malformed: `http.NewRequest`'s error is ignored and the nil request is dereferenced on the next line. Self-DoS via the operator's own env var, but a crash \+ stack trace instead of a clean error.

## Root Cause

`cmd/xe/main.go:1131-1132`:

```
req, _ := http.NewRequest("POST", nodeURL()+"/lease/"+hash+"/renew", bytes.NewReader(body))
req.Header.Set("Content-Type", "application/json")
```

`NewRequest` returns a nil request on a malformed URL; the error is discarded with `_`, and `req.Header.Set` panics. Requires `XE_API_ADMIN_TOKEN` set to reach (`:1126-1129`). This is the only site with this pattern — `client/chat.go:81` checks the error, and a grep confirms no other ignored `NewRequest` in `cmd/`/`client/`/`api/`/`node/`.

## Verification

Executed:

```
$ XE_API_ADMIN_TOKEN=x XE_NODE="://bad" xe lease renew <64-hex> 60
panic: runtime error: invalid memory address or nil pointer dereference
goroutine 1 [running]:
main.cmdLeaseRenew(...)
	/home/hatch/workspace/xe/xe/cmd/xe/main.go:1132
```

## Note on related reports

Searched "lease renew panic nil request" — #496 (node-side post-commit gossip failure) and #215 are different mechanisms.

## Suggested fix

Check the `NewRequest` error and fail with a clean message (`fatal("invalid XE_NODE: %v", err)`).

### Thread

**Joseph Denne**team2026-11-22 23:26 UTCdesk

Thanks. This is the same finding as an earlier report that is not public, 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-16981 and says what differs; it is read like any other.
