AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 41 Bitcoin

feat (wasm): Adds csv/print to wasm iframes, core theme passing, optional unhashed description, scoped invoice status, fiat checkout and browser storage (#4328)

Public commit record

What the developer wrote

Authored by Arc

73/100 · Adequate
feat (wasm): Adds csv/print to wasm iframes, core theme passing, optional unhashed description, scoped invoice status, fiat checkout and browser storage (#4328)

Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit adds several new features to LNbits' WebAssembly (WASM) extension system. It introduces ways for extensions to: check invoice status, refresh payment status, create fiat checkout invoices, store small amounts of data in the browser, export/print CSV documents, and receive theme information. The changes also strengthen how invoices are tied to the extension that created them, replacing loose dictionary data with a stricter typed structure and adding verification of invoice description hashes. Most changes are defensive in nature and include extensive tests, but they expand the attack surface of the WASM extension bridge and payment APIs.

Recommended action

Review the new WASM host API methods and bridge handlers as part of normal security review. Pay particular attention to: (1) `wallet.refresh_payment` ensuring it cannot be used to probe arbitrary payments or trigger repeated backend queries; (2) `wallet.create_fiat_invoice_public` URL validation and provider allowlist logic in real deployments; (3) `storage.local.*` quota enforcement and scoping under concurrent or malicious iframe contexts; (4) `ui.download_csv` formula-escaping and filename validation; (5) `ui.print_document` sandbox attributes and print iframe cleanup. The commit includes tests, but integration/end-to-end tests of the iframe boundary and shared-wallet scenarios would strengthen assurance.

Security signals we found

01

Untrusted `extension_context` dictionary replaced by frozen typed model `PaymentExtensionContext` with required `extension_id`, `owner_id`, `wallet_id`, and optional `source_id`.

02

New `wallet.invoice_status` method enforces strict binding checks (extension, owner, wallet, source) before returning only `paid/pending/failed/amount-msat`; rejects legacy/unbound invoices.

03

New `wallet.refresh_payment` requires authentication, wallet ownership or shared-wallet VIEW_PAYMENTS permission, and scopes payment lookup by wallet; hides backend error details.

04

New `wallet.create_fiat_invoice_public` validates source policies, wallet ownership, receive permission, and provider allowlist; sanitizes checkout URL (HTTPS only, no credentials, no control chars, max 4096 chars).

05

Public invoice creation now optionally verifies BOLT11 `description_hash` against caller-supplied `unhashed_description` to prevent metadata mismatch attacks.

06

Frontend bridge adds `storage.local.*` with per-extension/account/page scoping, 128-key/64 KiB quotas, 180-day TTL, key/value validation, and permission gating.

07

Frontend bridge adds `ui.download_csv` and `ui.print_document` with user confirmation, filename validation, formula-escaping, bounded tables, sandboxed print iframe, and no extension HTML/scripts.

08

Theme bridge exposes only an allowlisted color snapshot and dark flag via `postMessage`; does not allow extension-driven theme mutations.

09

Pagination `limit=0` added for count-only storage queries under the same permission/owner restrictions.

Risk score

Why this scored 41/100

Our methodology →
Potential impact 8/30
Exploitability 7/25
Stealth signal 6/15
Affected reach 9/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.