{"id":"XE-1788","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":451,"title":"Exported `verifySignature` throws on malformed signatures instead of returning `false`","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:09:25.846155+00:00","updated_at":"2026-11-14T22:57:04.296924+00:00","source_created_at":null,"told_at":null,"status_changed_at":"2026-11-14T22:56:52.937477+00:00","url":"https://bounty.xe.network/XE-1788","body":"## Summary\r\n\r\n`sdk/src/wallet.ts` `verifySignature` calls\r\n`hexToBytes(signature, 64)`, which throws on malformed input\r\n(`hexToBytes: expected 64 bytes, got 2`; `not lowercase hex` on\r\nnon-hex). Internal use is safe (`attestation.ts:verifyAttestation`\r\nwraps it in try/catch), but the exported API forces every direct\r\ncaller to try/catch attacker- or node-supplied signatures or crash.\r\n\r\n## Impact\r\n\r\n- **Crash-on-bad-input in a verification API.** A verification\r\n  function that throws instead of returning `false` inverts its own\r\n  contract: the caller asked \"is this signature valid?\" and gets an\r\n  exception for the most common invalid inputs (short, non-hex).\r\n  Any caller that feeds it node- or peer-supplied signatures without a\r\n  try/catch crashes.\r\n- **Scope limit (stated plainly).** Internal SDK use is wrapped, so\r\n  the SDK itself does not crash. The exposure is to direct consumers\r\n  of the exported function.\r\n\r\n## Severity reasoning\r\n\r\n- **Minor, not Low:** a verification API that throws on invalid input\r\n  is a real API-contract defect, but the SDK's own call sites are\r\n  safe and the consequence for a direct caller is a crash they can\r\n  guard with one try/catch. Minor is honest.\r\n\r\n## Root cause\r\n\r\n`verifySignature` does not catch the decoding errors from\r\n`hexToBytes` and convert them to a `false` return.\r\n\r\n## Reproduction\r\n\r\n### A. Node test (primary evidence — PASS)\r\n\r\nHarness `/tmp/sdk-verify-r4/verify.mjs` (built `dist/`). Malformed\r\nsignatures (2 bytes; non-hex) throw instead of returning `false`.\r\nVerified in the harness run.\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`verifySignature`, signature verification throwing, or `hexToBytes`.\r\nNo known report covers this defect.\r\n\r\n## Suggested fix direction\r\n\r\n- Catch decoding errors in `verifySignature` and return `false`\r\n  (a malformed signature is, by definition, not a valid one).\r\n\r\n## References (file:line, sdk @ 605c20a)\r\n\r\n| Location | What it shows |\r\n|---|---|\r\n| `sdk/src/wallet.ts` (`verifySignature`) | `hexToBytes(signature, 64)` throws on malformed input |\r\n| `sdk/src/attestation.ts` (`verifyAttestation`) | Wraps the call in try/catch — internal use safe |\r\n| `/tmp/sdk-verify-r4/verify.mjs` | Verification harness |\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":[]}