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

wallet: reject unmodifiable PSBTs in addpsbtoutput/addpsbtinput

Public commit record

What the developer wrote

Authored by daywalker90

73/100 · Adequate
wallet: reject unmodifiable PSBTs in addpsbtoutput/addpsbtinput

Both commands took a user PSBT and appended to it without checking its
v2 modifiable flags, so libwally refused the change and lightningd
crashed:

```
lightningd: bitcoin/psbt.c:269: psbt_add_output: Assertion `wally_err == WALLY_OK' failed.
wallet/reservation.c:728 (json_addpsbtoutput)

lightningd: bitcoin/psbt.c:233: psbt_append_input: Assertion `wally_err == WALLY_OK' failed.
wallet/reservation.c:302 (psbt_using_utxos)
wallet/reservation.c:892 (json_addpsbtinput)
```

Check the flags up front and return an error instead.

Changelog-Fixed: JSON-RPC: `addpsbtoutput` and `addpsbtinput` no longer crash when given a v2 PSBT that does not allow modification.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This update fixes a crash in two wallet commands, addpsbtoutput and addpsbtinput. These commands let users add extra transaction outputs or inputs to a PSBT (a Bitcoin transaction planning file). If a user supplied a PSBT whose version 2 'modifiable' flags forbade such changes, the underlying library refused the operation and the lightning daemon crashed with an assertion failure. The patch now checks those flags beforehand and returns a clean error instead of crashing.

Recommended action

Apply the patch. It is a low-risk, targeted fix that prevents a local denial-of-service crash by validating PSBT modifiability before mutation. No additional mitigation is required beyond upgrading.

Security signals we found

01

Daemon crash (assertion failure) on crafted/strict PSBT input

02

Missing validation of PSBT v2 modifiable flags before mutation

03

User-controlled input directly passed to libwally without precondition check

04

Fix converts a crash into a controlled JSON-RPC error

Risk score

Why this scored 62/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 8/15
Affected reach 10/15
Confidence 9/10
Evidence quality 5/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.