Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

elementsproject/lightning
master @ c4e8c4f
120
Fixes
0
CVEs
CRITICAL
Peak severity
16.1%
Coverage
Highlights
Denial of Service: 50 prior fixes. Scrutinize any change in this area.
lightningd: most-fixed (8 issues). Treat as high-risk during review.
43 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Auth Bypass: The commando plugin historically failed to mandate and properly validate authorization tokens (runes), permitting unauthorized RPC command execution on the node. Developers must ensure that 'check_rune' is strictly called on all incoming command paths.
Cryptographic Issues: Critical cryptographic operations were executed before the HSM daemon completed its secure initialization protocol (WIRE_HSMD_INIT), or derived keys using faulty structure sizing inside HKDF routines. Strict state checks must precede any signing operations.
Memory Corruption: Buffer overflows, such as writing a libsodium 32-byte HMAC directly into a smaller 20-byte destination buffer, demonstrate the high risk of mismatched structure assumptions when integrating external cryptographic libraries. Strict length checks and proper destination allocation are required.