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

hsmd: check *all* anchor inputs for short sigs.

Public commit record

What the developer wrote

Authored by Rusty Russell

78/100 · Adequate
hsmd: check *all* anchor inputs for short sigs.

Anchors will have one input from the commitment tx, and at least on
more (in this case, 3 more); we were only checking the first one for
short signatures.

```
total_feerate_perkw = total_fees / total_weight * 1000
> check_feerate([l3, l2], total_feerate_perkw, feerate)

tests/test_closing.py:4064:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

nodes = [<fixtures.LightningNode object at 0x7f3e9a2c74f0>, <fixtures.LightningNode object at 0x7f3e991d5f30>]
actual_feerate = 14006.105538595726, expected_feerate = 14000

def check_feerate(nodes, actual_feerate, expected_feerate):
# Feerate can't be lower.
assert actual_feerate > expected_feerate - 2
if actual_feerate >= expected_feerate + 2:
if any([did_short_sig(n) for n in nodes]):
return
# Use assert as it shows the actual values on failure
> assert actual_feerate < expected_feerate + 2
E AssertionError
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ 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 fixes a test-only diagnostic check in Core Lightning's hardware signing daemon (HSM). The code warns developers if a Bitcoin signature is unusually short (a sign of 'overgrinding' during signature creation), but it only checked the first input of an anchor-spending transaction. Anchor transactions can have multiple inputs, so the check missed short signatures on the other inputs. This is a testing/quality fix, not a vulnerability that attackers can exploit.

Recommended action

No urgent action. Treat as a minor developer-experience/test-reliability fix. Ensure tests that rely on overgrind warnings now cover multi-input anchor spends.

Security signals we found

01

Signature-length diagnostic expanded from first input to all inputs

02

No transaction rejection or policy enforcement added

03

Only active under dev_warn_on_overgrind developer flag

04

Fixes a test assertion failure in test_closing.py related to expected overgrind detection

Risk score

Why this scored 19/100

Our methodology →
Potential impact 3/30
Exploitability 0/25
Stealth signal 2/15
Affected reach 2/15
Confidence 8/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.