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

tests: show addpsbtoutput/addpsbtinput crash on an unmodifiable v2 PSBT

Public commit record

What the developer wrote

Authored by daywalker90

83/100 · Strong
tests: show addpsbtoutput/addpsbtinput crash on an unmodifiable v2 PSBT

A v2 PSBT without PSBT_GLOBAL_TX_MODIFIABLE (e.g. one signed by a
BIP-370 signer) makes libwally refuse new inputs and outputs, and both
commands then hit an assertion:

```
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)
```
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit only adds a new test case that demonstrates two Core Lightning commands, addpsbtoutput and addpsbtinput, crash with an internal assertion when given a v2 PSBT that does not allow adding inputs or outputs. The test is marked as expected to fail for now, so the underlying crash is not fixed in this commit. A remote or local user who can call these RPC commands with a crafted PSBT could cause the lightning daemon to abort.

Recommended action

Treat this as a reported bug requiring a defensive fix: validate PSBT_GLOBAL_TX_MODIFIABLE before invoking libwally add-input/output operations, and return a clean RPC error instead of asserting. The test should be promoted from xfail to passing once the fix lands. Monitor for a follow-up commit that removes the xfail marker.

Security signals we found

01

Daemon abort due to failed assertion in PSBT helper functions

02

RPC commands addpsbtoutput and addpsbtinput lack validation of PSBT modifiability flags before calling libwally

03

Potential denial-of-service vector: any caller able to submit a crafted v2 PSBT can crash lightningd

04

Test is marked xfail, confirming the crash behavior is known and unfixed in this commit

Risk score

Why this scored 59/100

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