`solvePow` with `progressInterval: 0` never returns on the JavaScript PoW path
Report
Summary
sdk/src/pow.ts solveJs runs its inner loop as for (i < interval); with interval 0 the inner loop never executes, and the
outer loop yields forever. Verified in a fresh process (WebAssembly
disabled to force the JS path, difficulty 0): the call was still
unresolved after 3 seconds. The WASM path clamps via
Math.max(interval, 1<<16), so only the JS path hangs.
Impact
- Local self-DoS. A caller that passes
progressInterval: 0(e.g. intending "no progress callbacks") gets a promise that never resolves, hanging whatever flow calledsolvePow— including lease and send flows that PoW every block. - Scope limit (stated plainly). Only when WebAssembly is unavailable (the WASM path clamps) and only when the caller explicitly passes 0. The victim is the caller's own process; no other party is affected and no funds are at risk.
Severity reasoning
- Minor, not Low: the trigger is narrow (explicit 0 + no WASM) and the harm is confined to the caller's own process hanging. A hang-on-zero bug in a public API is real, but with no other party affected and an easy workaround (don't pass 0), Minor is honest.
Root cause
solveJs does not clamp interval the way the WASM path does, so 0
produces an inner loop that never runs and an outer loop that never
terminates.
Reproduction
A. Node test (primary evidence — PASS)
Harness /tmp/sdk-verify-r4/h1.mjs (built dist/, WebAssembly
disabled, difficulty 0). solvePow with progressInterval: 0 was
still unresolved after 3s — verified hang.
Dedup note
Checked against the live public report list at https://bounty.xe.network
(166 public tickets, checked 2026-11-09). No title or body match for
solvePow, progressInterval, or a PoW hang. No known report covers
this defect.
Suggested fix direction
- Clamp the interval in
solveJsthe same way the WASM path does (Math.max(interval, 1<<16)), or treat 0 as "no progress callbacks" with a sane default chunk size.
References (file:line, sdk @ 605c20a)
| Location | What it shows |
|---|---|
sdk/src/pow.ts (solveJs) |
Inner loop for (i < interval) never executes at interval 0; outer loop yields forever |
sdk/src/pow.ts (WASM path) |
Clamps via Math.max(interval, 1<<16) — the JS path lacks this |
/tmp/sdk-verify-r4/h1.mjs |
Verification harness (fresh process, WASM disabled) |
Payout address
052e33e0ed9c43e2bdf07faff9a90d25642b51d53d96f49f5d45b81f6584b3da
NOTE — operator must confirm this payout address (or replace it with their own) before submission. This is the hunt testnet wallet generated for faucet/PoC work; it is the address the reporter intends to receive any award at, pending operator confirmation.
Thread
Thank you for this report. We have read it against the code and it is being handled. The assessment and any award follow the fix. https://bounty.xe.network/XE-1786