<!-- XE-16982 · [Low] Web UI trusts server-advertised PoW difficulty with no bound, timeout, or cancel · testnet -->
*Markdown view of <https://bounty.xe.network/XE-16982>. The page is the record; this is the same page for reading.*

XE-16982 · Bounty

# \[Low\] Web UI trusts server-advertised PoW difficulty with no bound, timeout, or cancel

Closed · duplicate
—
[xe#693](https://github.com/xeprotocol/xe/issues/693)
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

- [770032](https://bounty.xe.network/log/770032) 2026-11-22 23:26 UTC reply.mirror\_failed
- [769810](https://bounty.xe.network/log/769810) 2026-11-22 23:26 UTC proposal.adopted
- [769809](https://bounty.xe.network/log/769809) 2026-11-22 23:26 UTC reply.sent
- [769808](https://bounty.xe.network/log/769808) 2026-11-22 23:26 UTC ticket.status new → closed
- [768735](https://bounty.xe.network/log/768735) 2026-11-22 23:25 UTC proposal.adopted
- [768734](https://bounty.xe.network/log/768734) 2026-11-22 23:25 UTC ticket.facts area
- [768733](https://bounty.xe.network/log/768733) 2026-11-22 23:25 UTC proposal.adopted
- [768732](https://bounty.xe.network/log/768732) 2026-11-22 23:25 UTC ticket.facts
- [768731](https://bounty.xe.network/log/768731) 2026-11-22 23:25 UTC proposal.adopted
- [768730](https://bounty.xe.network/log/768730) 2026-11-22 23:25 UTC ticket.facts
- [766709](https://bounty.xe.network/log/766709) 2026-11-22 23:18 UTC note.added
- [766708](https://bounty.xe.network/log/766708) 2026-11-22 23:18 UTC proposal.created

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

### Report

## Summary

The web UI trusts server-advertised PoW difficulty with no bound, timeout, or cancel. `getDifficulties()` takes `pow_difficulty`/`chat_pow_difficulty` straight from `GET /api/node`, `parseHexDifficulty` accepts any 1–16 hex chars (up to 2⁶⁴−1), and `solvePow` loops `for (;;)` with no deadline or AbortSignal. A compromised or misconfigured local node freezes both send flows (wallet send and chat send) until the tab is closed.

## Root Cause

- `web/assets/pow.js:71-94` `getDifficulties()` takes the difficulties from `GET /api/node` with no cap; `parseHexDifficulty` (`:91-94`) accepts any 1–16 hex chars.
- `solvePow` (`:22-62`) loops `for (;;)` with no deadline or AbortSignal (higher value \= harder; default `0xfffff80000000000` ≈ 2²¹ hashes, max ≈ 2⁶⁴).
- Both callers await it unguarded: `xe-block.js:330-333` `computePow()` (wallet send; button disabled, shows 'signing \+ computing pow…', `wallet.js:839`) and `chat-envelope.js:43-44` `buildEnvelope()` (chat send; 'solving pow…', `chat.js:349`). No cancel control exists.

## Verification

Executed PoC importing the real `pow.js` (`node poc.mjs`):

```
difficulty 0x1 (trivial)                : SOLVED in 4ms
difficulty 0xfffff80000000000 (default) : NOT SOLVED after 30000ms — loop still running, no timeout/cancel
difficulty 0xffffffff00000000 (~2^32)    : NOT SOLVED after 10000ms — loop still running, no timeout/cancel
difficulty 0xffffffffffffffff (max)     : NOT SOLVED after 10000ms — loop still running, no timeout/cancel
```

Even the default difficulty can pin the UI for 30s\+; at/near max it never returns.

## Note on related reports

Searched "web wallet PoW difficulty unbounded" (0 hits). Distinct from **#397** (Go CLI chat path only; #397 explicitly says the block-signing path is unaffected because the Go CLI uses constant `core.DefaultDifficulty` — the web UI does NOT use a constant). Threat model is weaker than #397's (UI proxies to the local node) → Low.

## Suggested fix

Cap the accepted difficulty (e.g. reject anything above a sane maximum), add a timeout and a cancel control to `solvePow`, and surface a clear error when PoW does not complete in time.

### 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-16982 and says what differs; it is read like any other.
