{"id":"XE-1786","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":451,"title":"`solvePow` with `progressInterval: 0` never returns on the JavaScript PoW path","area":"sdk-docs-web","claimed_tier":"minor","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-09T04:06:43.082054+00:00","updated_at":"2026-11-14T22:57:04.296924+00:00","source_created_at":null,"told_at":"2026-11-10T14:00:35.210843+00:00","status_changed_at":"2026-11-10T14:00:33.538761+00:00","url":"https://bounty.xe.network/XE-1786","body":"## Summary\r\n\r\n`sdk/src/pow.ts` `solveJs` runs its inner loop as `for (i <\r\ninterval)`; with `interval` 0 the inner loop never executes, and the\r\nouter loop yields forever. Verified in a fresh process (WebAssembly\r\ndisabled to force the JS path, difficulty 0): the call was still\r\nunresolved after 3 seconds. The WASM path clamps via\r\n`Math.max(interval, 1<<16)`, so only the JS path hangs.\r\n\r\n## Impact\r\n\r\n- **Local self-DoS.** A caller that passes `progressInterval: 0`\r\n  (e.g. intending \"no progress callbacks\") gets a promise that never\r\n  resolves, hanging whatever flow called `solvePow` — including lease\r\n  and send flows that PoW every block.\r\n- **Scope limit (stated plainly).** Only when WebAssembly is\r\n  unavailable (the WASM path clamps) and only when the caller\r\n  explicitly passes 0. The victim is the caller's own process; no\r\n  other party is affected and no funds are at risk.\r\n\r\n## Severity reasoning\r\n\r\n- **Minor, not Low:** the trigger is narrow (explicit 0 + no WASM)\r\n  and the harm is confined to the caller's own process hanging. A\r\n  hang-on-zero bug in a public API is real, but with no other party\r\n  affected and an easy workaround (don't pass 0), Minor is honest.\r\n\r\n## Root cause\r\n\r\n`solveJs` does not clamp `interval` the way the WASM path does, so 0\r\nproduces an inner loop that never runs and an outer loop that never\r\nterminates.\r\n\r\n## Reproduction\r\n\r\n### A. Node test (primary evidence — PASS)\r\n\r\nHarness `/tmp/sdk-verify-r4/h1.mjs` (built `dist/`, WebAssembly\r\ndisabled, difficulty 0). `solvePow` with `progressInterval: 0` was\r\nstill unresolved after 3s — verified hang.\r\n\r\n## Dedup note\r\n\r\nChecked against the live public report list at https://bounty.xe.network\r\n(166 public tickets, checked 2026-11-09). No title or body match for\r\n`solvePow`, `progressInterval`, or a PoW hang. No known report covers\r\nthis defect.\r\n\r\n## Suggested fix direction\r\n\r\n- Clamp the interval in `solveJs` the same way the WASM path does\r\n  (`Math.max(interval, 1<<16)`), or treat 0 as \"no progress\r\n  callbacks\" with a sane default chunk size.\r\n\r\n## References (file:line, sdk @ 605c20a)\r\n\r\n| Location | What it shows |\r\n|---|---|\r\n| `sdk/src/pow.ts` (`solveJs`) | Inner loop `for (i < interval)` never executes at interval 0; outer loop yields forever |\r\n| `sdk/src/pow.ts` (WASM path) | Clamps via `Math.max(interval, 1<<16)` — the JS path lacks this |\r\n| `/tmp/sdk-verify-r4/h1.mjs` | Verification harness (fresh process, WASM disabled) |\r\n\r\n## Payout address\r\n\r\n```\r\n052e33e0ed9c43e2bdf07faff9a90d25642b51d53d96f49f5d45b81f6584b3da\r\n```\r\n\r\n**NOTE — operator must confirm this payout address (or replace it with\r\ntheir own) before submission.** This is the hunt testnet wallet generated\r\nfor faucet/PoC work; it is the address the reporter intends to receive\r\nany award at, pending operator confirmation.","patch_refs":[],"thread":[{"id":2140,"source":"desk","source_ref":"reply:1507","author":"Joseph Denne","team":true,"body":"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","created_at":"2026-11-10T14:00:19.792775+00:00"}]}