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

tests: add configurable misbehavior to the mock LSPS2 service

Public commit record

What the developer wrote

Authored by Peter Neuroth

100/100 · Strong
tests: add configurable misbehavior to the mock LSPS2 service

Each phase of the mock gets a table of named behaviors, each with its
own parameters, so that every attack in the security matrices is one
config entry:

- transport: drop, wrong_id, duplicate (optionally with a changed
second result), replace (send a raw payload), add_fields and error,
optionally limited to some methods.
- buy: the jit_channel_scid is a fixture too, next to
lsp_cltv_expiry_delta and client_trusts_lsp.
- open: never, or twice.
- htlc: deduct (per-part deduction and extra_fee, or no TLV),
forward_subset (fail the other parts) and deduct_again (charge the fee
again after the session).

lsps2-mock-send sends a message outside of any request and
lsps2-mock-open opens a zero-conf channel outside of any session.
Unknown behaviors and parameters, and missing required ones, are
rejected when the config is set.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit only adds new testing capabilities to a mock LSPS2 service used in Core Lightning's test suite. It lets developers simulate misbehaving LSPs (e.g., dropping messages, sending wrong IDs, opening channels twice, deducting fees incorrectly) so they can verify that the real client handles those cases safely. The change does not alter production code, wallets, or node behavior, and it does not fix or introduce any real vulnerability.

Recommended action

No security action required. Treat as normal test-suite enhancement. Reviewers may optionally confirm that the new tests exercise the intended client hardening against the simulated attacks.

Security signals we found

01

No production code modified

02

Changes are entirely inside tests/plugins/ and tests/test_cln_lsps.py

03

New behaviors are explicitly documented as test-only mock misbehavior

04

No privilege escalation, authentication bypass, or cryptographic weakness introduced

05

No network-facing behavior change in shipped software

Risk score

Why this scored 15/100

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