LDK
← All projectsLightning Dev Kit

rust-lightning

Composable Rust libraries for building Lightning wallets, nodes, and services.

BitcoinCryptographic librariesLightning NetworkNormal
Repository coverage

1924 commits in the local evidence base

Every captured commit receives deterministic security triage and a separate communication-quality score. Security candidates and broader second-pass signals receive full-patch Ollama analysis.

300security candidates261second-pass queue1606AI analyses
174commits · 30 days
261commits · 60 days
636commits · 180 days
1314commits · 365 days
Backfill bands
Aug 5 → Feb 6819 seen18 candidatesComplete
Feb 6 → Jun 6468 seen16 candidatesComplete
Jun 6 → Jul 6128 seen8 candidatesComplete
Jul 6 → Aug 561 seen3 candidatesComplete
Commit communication

Does the history explain itself?

Message quality measures whether a commit identifies its scope, purpose, rationale, testing, and supporting references. It does not change the security-severity score.

71/100 average clarity
704Strong · 80–100
856Adequate · 60–79
302Thin · 40–59
62Opaque · 0–39
3security candidates with opaque commit messaging
Read the scoring rubric →
Developer activity

Who is changing the project?

Public Git author strings; identities are not independently verified.

DeveloperCommitsCandidatesAnalyzedHigh riskMessage avg.
Matt Corallo58679418876
Elias Rohrer15415153667
auto-pr-bot571823287
Jeffrey Czyz19645182169
Wilmer Paulino15945155169
Valentine Wallace15715145169
Leo Nash11613116162
Vincenzo Palazzo11311183
Joost Jager16324162069
elnosh401434059
shaavan22622069
wpaulino2059082
Analysis record

Published AI watches

Last scanned 48 minutes ago

Informational 15 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Correct FeeEstimator docs on the 253 sat/kW lower bound

This is a documentation-only edit. It corrects a misleading comment in the code that wrongly claimed all fee estimates returned to LDK are forced to be at least 253 satoshis per 1000 weight units. The new comment clarifies that this minimu…

ea2051feby auto-pr-bot+9−31 file
No security note in commit
Moderate 54 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Track splice confirmation while awaiting tx_signatures' (#5570)

This change fixes a bug in Lightning Dev Kit's splicing logic. During a splice, one side can broadcast the new funding transaction as soon as it has the other side's signatures. Previously, if that transaction confirmed on-chain before the…

State-machine inconsistency in channel funding lifecycleMissing chain-source watch for in-flight splice funding transactionPotential failure to send splice_locked after splice confirms during signature exchange
ca778e61by Matt Corallo+245−32 files
No security note in commit
Moderate 63 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Account for current HTLC fees in dust exposure' (#5690)

This change fixes how Lightning nodes calculate the financial risk from tiny ('dust') HTLCs when the current on-chain fee rate is higher than the node's own local fee estimate. Previously, the code only considered a buffered fee rate when …

Incorrect fee exposure accounting for dust HTLCsPotential to accept HTLCs whose commitment/HTLC-success fees exceed their value under current feerateEconomic griefing / forced-channel-closure cost manipulation
cc798f60by Matt Corallo+108−382 files
No security note in commit
Informational 15 AI analysisMessage 91 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Replace cloned array literal with slice::from_ref in reload test' (#5689)

This is a one-line code cleanup in a test file. It replaces a cloned array literal with a slice reference to silence a Rust compiler lint. There is no change to production code, no security fix, and no functional behavior change.

03ca832fby Matt Corallo+1−11 file
No security note in commit
Informational 15 AI analysisMessage 91 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Replace cloned array literal with slice::from_ref in reload test

This is a one-line change in a test file to satisfy a Rust linter warning. It replaces a needless clone of a funding transaction with a reference-based slice construction. There is no functional change, no user-facing behavior change, and …

93e0129cby auto-pr-bot+1−11 file
No security note in commit
Informational 12 AI analysisMessage 91 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Fix CI: rebuild test coin-selection impl and rework reused-ID balance test' (#5684)

This commit is a test-only fix for a broken continuous integration (CI) build. It updates a test mock to match a new function signature and rewrites an existing test to use three nodes instead of two so the test scenario remains valid unde…

17bac68aby Matt Corallo+26−202 files
No security note in commit
Moderate 68 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Guard pending closing signatures before channel_ready' (#5681)

This change fixes a Lightning channel bug where a malicious peer could renegotiate the closing transaction fee while the local node was still waiting for its own signer to produce the final signature. If allowed, the local node might combi…

State-machine guard expansion to prevent fee renegotiation while a closing signature is pendingRisk of combining mismatched signatures across different closing feesRegression test demonstrates malicious peer renegotiation attempt and expected warning rejection
a01273a2by Matt Corallo+169−21 file
No security note in commit
Low 48 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Release wallet UTXOs when FundingBuilder rejects a coin selection' (#5634)

This change fixes a wallet bug in rust-lightning where a UTXO could be selected for a Lightning funding transaction, then rejected because its previous transaction was too large to fit in a Lightning peer message. Previously, that rejectio…

API change to CoinSelectionSource::select_confirmed_utxos adding max_input_prevtx_serialized_lenWalletSync filters UTXOs by prevtx serialized length before selectionFundingBuilder enforces Lightning tx_add_input message-size limit at selection time
56054190by Matt Corallo+148−155 files
No security note in commit
Low 48 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Refuse to pay BOLT 12 invoices with records above experimental range

This commit hardens LDK's BOLT 12 payment logic so it refuses to pay invoices containing very large unknown record types (4 billion and up). These records are legal under the Lightning spec, but LDK doesn't understand them, so the change t…

Defensive refusal to pay invoices with unknown high-numbered TLV recordsReuses existing UnknownRequiredFeatures failure path instead of adding a new oneAdds explicit checks before payment state insertion and route construction
2970372fby auto-pr-bot+106−177 files
No security note in commit
Moderate 64 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Read invoice TLV records above the experimental range

This commit fixes a backward-compatibility bug in LDK's BOLT 12 invoice parser. A previous change had capped the range of 'experimental' TLV record types at 4 billion, but the Lightning spec imposes no upper bound. As a result, invoices cr…

Backward-compatibility regression in deserialization of persisted channel monitorsDenial-of-service via unreadable monitor blocking all channel monitoringSpec compliance fix: TLV record types have no upper bound
9e28db58by auto-pr-bot+133−84 files
No security note in commit
High 74 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Refuse to sign messages that collide with gossip serializations' (#5677)

This change fixes a security issue where a signed text message could be crafted so that its prefixed form looks exactly like a Lightning 'node_announcement' gossip message. Because both use the same double-SHA256 hash and the same signing …

Signature replay / message confusion between signed messages and gossip announcementsForged `node_announcement` signatures via chosen-prefix message constructionNew validation rejects prefixed messages that deserialize as `UnsignedNodeAnnouncement`
ec40e097by Matt Corallo+74−148 files
Vendor flagged security relevance
Low 37 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Retry a single HTLC before abandoning an unfundable batch' (#5406)

This change fixes a corner case in how the Lightning node tries to claim multiple pending HTLCs (small Bitcoin payments locked in a channel) when the wallet cannot fund a single large batch transaction. Previously, if the multi-HTLC batch …

Funds-recovery robustness improvement: prevents premature abandonment of a single unbatched HTLCChange in error-handling arithmetic from checked_sub/saturating_sub with max(1)New unit tests covering both failed and successful singleton HTLC funding paths
643e8684by wpaulino+119−21 file
No security note in commit
Moderate 54 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Refuse to persist fresh monitors that alias archived monitors' (#5645)

This change prevents a Lightning node from accidentally overwriting an archived copy of a channel's security monitor with a brand-new one that happens to use the same identifier. In the old code, if a new channel reused the same identifier…

Data-loss prevention: stops archived ChannelMonitor from being overwritten by a later channel with the same keySafety guard added to both sync and async persistence pathsPersistence refusal surfaces as InProgress/UnrecoverableError rather than silent overwrite
3c606c11by Matt Corallo+298−332 files
No security note in commit
Moderate 52 AI analysisMessage 86 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Handle fee multiplication overflow when merging MPP paths' (#5288)

This change fixes a place in the Lightning payment routing code where adding up fees could overflow the maximum number a computer can store in a 64-bit integer. Previously, the code assumed this could never happen and would crash (panic) i…

Integer overflow in fee computationPreviously unreachable!() panic path reachableMPP path merge could trigger overflow
25f8a740by Matt Corallo+42−171 file
No security note in commit
Low 43 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Resume channels stuck awaiting a completed monitor persistence on reload' (#5610)

This commit fixes a bug where a Lightning node could get stuck after restarting. If the node crashed or restarted while it was still saving the initial channel monitor to disk, and that save later finished in another process, the restarted…

Fixes a state-machine stall on node reload that could leave channels non-functionalRemoves an overstrict assertion that would panic on a legitimate post-reload stateAdds explicit detection of monitor persistence completed in a prior process
11815ed1by Matt Corallo+334−74 files
No security note in commit
Informational 15 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Correct KeysManager docs on spliced channels' remote_key derivation' (#5609)

This change only updates documentation and code comments in the Lightning Dev Kit library. It clarifies that a particular key-derivation setting is fixed when a channel is first opened and is not changed by splicing. No code behavior was a…

83a4d243by Matt Corallo+17−91 file
No security note in commit
Informational 15 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Fix DelayedPaymentKey/HtlcKey from_basepoint docs and document justice tx witness script' (#5596)

This commit only changes documentation comments in two source files. It corrects the wording of how certain public keys are derived in the Lightning protocol and adds details about which witness script a signer must use when creating justi…

Documentation-only changeClarifies key derivation semantics for Lightning commitment transactionsClarifies justice transaction witness script requirements for signers
2f832195by Matt Corallo+44−62 files
No security note in commit
Informational 19 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Document that TokioSpawner requires all of LDK in a tokio context' (#5621)

This change only adds documentation comments to a Rust struct. It does not modify any executable code, so it cannot by itself introduce or fix a security vulnerability. The new text warns developers that using TokioSpawner incorrectly can …

Documentation-only changeNo code logic modifiedNo unsafe blocks added
6e555fa2by Matt Corallo+11−01 file
No security note in commit
High 70 AI analysisMessage 91 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Make custom signers verify holder commitment sigs synchronously' (#5616)

This commit hardens how Lightning Dev Kit handles custom signing modules. Previously, LDK relied on each custom signer to check that the other party's signatures on a holder commitment transaction were valid. The change adds a ready-made v…

New synchronous signature-verification helper for holder commitment transactionsTrait documentation now mandates verification before Ok(()) because LDK acts immediatelyInMemorySigner now validates that holder funding key belongs to signer before signature checks
0e3b6d33by Matt Corallo+324−954 files
Vendor flagged security relevance
Moderate 64 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Refuse channel_ready while the initial funding_signed is pending' (#5612)

This update fixes a corner case in the Lightning Dev Kit where a node could get confused if it received a 'channel_ready' message while still waiting for its own signer to produce the first commitment signature. The patch makes the node re…

State-machine confusion between funding_signed and channel_ready in async signer flowPremature channel_ready could advance counterparty_next_commitment_point before initial commitment is signedPatch closes channel rather than allowing inconsistent commitment state
d68d2235by Matt Corallo+101−12 files
No security note in commit
Repository ledger

Explore captured commits

Expand any commit for its author, full message, clarity score, changed files, triage signals, analysis, and source link.

Lower-priorityCheck metadata length for bolt11 invoicesby elnosh · 87ea15c3 · Jun 23, 2026 · 1 fileMessage 60 · AdequateModerate 60Details
Commit message · elnosh

Check metadata length for bolt11 invoices

Check that the metadata when creating a bolt11 invoice is below
the bolt11 limit of 639 bytes for tagged fields.

60/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Moderate 60/100

This commit fixes a missing length check when creating BOLT11 Lightning invoices. Before the fix, a user or attacker could supply payment metadata longer than the 639-byte BOLT11 limit, producing an invoice that violates the protocol and may fail to be parsed or routed correctly. The patch now rejects oversized metadata during invoice creation, similar to the existing check for descriptions.

Lower-priorityFix stable clippy string repeat lintby Joost Jager · 999ab2db · Jun 23, 2026 · 1 fileMessage 70 · AdequateInformational 15Details
Commit message · Joost Jager

Fix stable clippy string repeat lint

Use str::repeat in DebugMsg tests to satisfy current stable clippy.

70/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit only changes three lines inside test code to use a different, clippy-preferred way of repeating a string. It does not touch any production logic, network handling, cryptography, or wallet code. There is no security relevance.

AI review queuedDrop duplicate Hasher importby Abeeujah · b4f74165 · Jun 23, 2026 · 1 fileMessage 35 · OpaqueInformational 15Details
Commit message · Abeeujah

Drop duplicate Hasher import

35/100 · OpaqueMessage clarity
✓ Descriptive subject! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Informational 15/100

This commit removes a duplicate import of the `Hasher` trait in a Rust source file. It is a code cleanup change with no functional or security effect. The `Hasher` symbol was already imported elsewhere in the same scope, so the duplicate import only generated a compiler warning. No behavior of the Lightning Dev Kit code changes as a result.

Lower-prioritySimplify ChannelUnavailable APIError handling with let-elseby Abeeujah · e9e3060b · Jun 22, 2026 · 1 fileMessage 73 · AdequateInformational 15Details
Commit message · Abeeujah

Simplify ChannelUnavailable APIError handling with let-else

Refactor the nested match statement used during error construction into
a more idiomatic let-else construct (stabilised in Rust 1.65). The
previous implementation required verbose, nested matching to navigate
around borrow checker limitations.

By leveraging let-else alongside chaining unwrap_err on handle_error
Result, we achieve the same teardown logic (dropping state locks)
and error mapping with significantly less boilerplate and nesting.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This is a pure code cleanup that rewrites an awkward nested match statement into a newer, more idiomatic Rust construct called let-else. It does not change what the program does, what data it accepts, or how it responds to errors. There is no security-relevant behavior change.

Security candidateFormat possiblyrandom cfg attributesby Joost Jager · bc01a548 · Jun 19, 2026 · 1 fileMessage 50 · ThinInformational 15Details
Commit message · Joost Jager

Format possiblyrandom cfg attributes

Run rustfmt on the possiblyrandom crate so its cfg attributes match
the current formatting rules.

50/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides an explanatory body
Why it was queued
seed or entropy path
AI analysis · Informational 15/100

This commit is purely a code-formatting cleanup. It runs rustfmt on a small Rust source file so that multi-line conditional compilation (cfg) attributes are collapsed onto single lines. No logic, behavior, or security properties of the code change.

Lower-priorityFix string slicing in TXT record validationby Matt Corallo · ae852b58 · Jun 18, 2026 · 1 fileMessage 73 · AdequateModerate 62Details
Commit message · Matt Corallo

Fix string slicing in TXT record validation

Rust's panicy string slicing behavior has always been a sharp edge
and here it finally caught up with us. Ensure we don't slice into
a string provided in an onion message until we're sure the index
is a character boundary.

Reported by Jordan Mecom of Block's Security Team

73/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
AI analysis · Moderate 62/100

This commit fixes a crash bug in how rust-lightning checks DNS text records embedded in private onion messages. The old code used string slicing that could panic if a TXT record contained multi-byte characters and the prefix length landed in the middle of a character. The fix compares raw bytes instead, avoiding the panic. A malicious or malformed onion message could have triggered a denial-of-service crash in the node processing it.

Security candidateGet real rand in `possiblyrandom` on supported platforms w/o featby Matt Corallo · b7c9935b · Jun 18, 2026 · 1 fileMessage 78 · AdequateModerate 61Details
Commit message · Matt Corallo

Get real rand in `possiblyrandom` on supported platforms w/o feat

It turns out that conditionally-enabling a dependency via `target`
in `Cargo.toml` does not enable the corresponding dependency
`feature` when compiling the code. As a result, only when building
`possiblyrandom` with an explicit `getrandom` feature did we ever
actually return random values.

This fixes this by matching the `target` cfg in `Cargo.toml` to the
cfg in `lib.rs`.

Reported by Project Loupe

78/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
Why it was queued
seed or entropy path
AI analysis · Moderate 61/100

This commit fixes a bug in a small helper crate called `possiblyrandom` used by the Lightning Dev Kit. The crate was supposed to return real random bytes on normal operating systems, but due to a Cargo.toml misconfiguration it was silently returning zeros unless an explicit feature flag was turned on. Randomness is important for cryptographic operations; using predictable zeros could weaken security in places that expect random input. The patch makes the code actually call the system's random source on supported platforms.

Lower-priorityTruncate logged peer message stringsby Elias Rohrer · e2f611e9 · Jun 18, 2026 · 3 filesMessage 68 · AdequateModerate 52Details
Commit message · Elias Rohrer

Truncate logged peer message strings

Counterparty-provided strings in network messages (Error, Warning,
TxAbort) were logged without length limits, allowing a malicious peer
to bloat log files. Some logging sites also lacked the same
sanitization used for other untrusted strings.

Add a `DebugMsg` struct and `log_msg!` macro that consistently
truncate messages to 512 characters while preserving `PrintableString`
sanitization. Replace all bare `msg.data` and ad hoc
`PrintableString(&msg.data)` usages at the 7 relevant logging sites
in `peer_handler.rs` and `channel.rs`.

Co-Authored-By: HAL 9000

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
defensive validation
AI analysis · Moderate 52/100

This commit fixes a minor denial-of-service issue where a malicious peer could send very long text strings inside Lightning network messages (errors, warnings, transaction aborts). Those strings were written to log files without any length limit or consistent cleanup, so an attacker could fill up disk space or make logs hard to read. The patch caps logged peer message strings at 512 characters and applies the project's usual untrusted-string sanitization everywhere these messages are logged.

Security candidateReject pre-epoch `LSPSDateTime` at parse timeby Elias Rohrer · 837763a6 · Jun 18, 2026 · 1 fileMessage 80 · StrongHigh 76Details
Commit message · Elias Rohrer

Reject pre-epoch `LSPSDateTime` at parse time

`LSPSDateTime::is_past` coerced `chrono`'s `i64` timestamp into a
`u64` via `try_into().expect(...)`. Because `LSPSDateTime` is parsed
from peer-controlled RFC 3339 strings (which can be pre-1970 and so
yield negative timestamps), this could be triggered remotely: an
attacker-supplied `valid_until` / `expires_at` field of e.g.
`"1900-01-01T00:00:00Z"` would parse successfully, land in LSPS state
before any HMAC / promise check, and panic the LSP thread on the next
`prune_pending_requests` sweep. Concretely reachable today via LSPS2
`opening_fee_params.valid_until` (in the buy request) and the LSPS1
expiry fields.

Make `LSPSDateTime::from_str` reject pre-epoch datetimes, and route
serde deserialization through it: `#[serde(transparent)]` was
delegating Deserialize directly to `chrono`'s impl and bypassing our
parser, so peer JSON had to be guarded separately. With both paths
funnelled through one parser, no `LSPSDateTime` value with a negative
inner timestamp can be constructed and `is_past` is safe by
construction.

Co-Authored-By: HAL 9000

80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
explicit security language
AI analysis · High 76/100

This commit fixes a remote denial-of-service bug in rust-lightning's LSPS (Lightning Service Provider Specification) code. An attacker could send a specially crafted date string from before 1970 (like "1900-01-01T00:00:00Z") in certain peer messages. The date would be accepted, and later when the software checked whether it had expired, it would panic and crash the LSP thread. The fix rejects any pre-1970 date during parsing, including when reading JSON from peers, so the dangerous value can never be created.

Lower-priorityReturn optional recovered BOLT11 payee keysby Elias Rohrer · 851d03f3 · Jun 18, 2026 · 1 fileMessage 68 · AdequateLow 47Details
Commit message · Elias Rohrer

Return optional recovered BOLT11 payee keys

Recovering a BOLT11 payee key can fail even when an invoice includes a
valid n field. Return the recovery result as an option and document
get_payee_pub_key as the canonical accessor.

Co-Authored-By: HAL 9000

This finding was discovered by Project Loupe

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 47/100

This commit changes how a Bitcoin Lightning invoice library exposes the payee's public key. Previously, a function called recover_payee_pub_key always returned a public key, even when mathematically recovering it from the invoice signature actually failed. Now it returns an optional value (None when recovery fails), and callers are directed to a safer accessor. The change prevents callers from silently getting a wrong or misleading key, which could matter for payment security decisions.

Security candidateUse BOLT11 invoice payee keys for payment paramsby Elias Rohrer · 06393eba · Jun 18, 2026 · 3 filesMessage 73 · AdequateModerate 63Details
Commit message · Elias Rohrer

Use BOLT11 invoice payee keys for payment params

Payment parameters should use the canonical payee key from BOLT11
invoices. When an invoice includes an n field, using that key avoids
attempting signature recovery that may legitimately be unavailable.

Co-Authored-By: HAL 9000

This finding was discovered by Project Loupe

73/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
Why it was queued
signing boundary
AI analysis · Moderate 63/100

This commit fixes a bug in how Lightning payment parameters are built from BOLT11 invoices. Previously, the code always tried to recover the payee's public key from the invoice signature, even when the invoice already explicitly included the payee's key. Signature recovery can fail or produce the wrong key in some legitimate cases, such as when the recovery ID byte is altered. The fix makes payment routing use the explicitly included payee key when available, falling back to signature recovery only when needed. This prevents potential payment routing failures or misrouting caused by relying on recoverable signatures.

Lower-priorityReject RGS snapshots that leave our graph absurdly-sizedby Matt Corallo · 7a89362c · Jun 18, 2026 · 3 filesMessage 78 · AdequateHigh 74Details
Commit message · Matt Corallo

Reject RGS snapshots that leave our graph absurdly-sized

If an RGS server sends snapshots that are absurdly-sized, they can
bloat a client's network graph, eventually leading to an OOM. While
we generally consider RGS servers to be semi-trusted (at least in
the sense that they can often simply not respond and leave a client
unable to find paths) we should still avoid allowing them to OOM a
client.

Thus, here, we naively start ignoring new channels from an RGS
server if they leave our graph 10x larger than we expect. This at
least avoids the OOM even if we end up not being able to make
payments.

Reported by Jordan Mecom of Block's Security Team

78/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
AI analysis · High 74/100

This commit fixes a denial-of-service weakness in Lightning Dev Kit's rapid gossip sync feature. A malicious or compromised RGS server could send an enormous snapshot of Lightning network data, causing a user's node to allocate so much memory that it crashes with an out-of-memory (OOM) error. The patch now rejects snapshots with absurdly high node counts and stops adding new channels once the graph grows about 10 times larger than expected. The issue was reported by Jordan Mecom of Block's Security Team.

AI review queuedAvoid over-allocating when reading corrupted lengths for `HashMap`sby Matt Corallo · 5b4626fa · Jun 18, 2026 · 1 fileMessage 73 · AdequateModerate 55Details
Commit message · Matt Corallo

Avoid over-allocating when reading corrupted lengths for `HashMap`s

Luckily this was only used in `ChannelManager` and scorer
deserialization, though we anticipate occasionally fetching the
second from an only semi-trusted source.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
second-pass: broader security terminology
AI analysis · Moderate 55/100

This commit fixes a denial-of-service risk when rust-lightning reads saved data containing HashMaps. A corrupted or malicious length field could previously trick the program into reserving a huge amount of memory before it had read any actual entries. The patch now caps the initial allocation to a safe maximum based on the largest buffer size the code is willing to handle. The commit message says the affected deserialization paths were mainly ChannelManager and scorer data, with scorer data sometimes coming from a semi-trusted source.

Lower-priorityFail held HTLCs on LSPS2 abandonby Joost Jager · ccc8b55f · Jun 18, 2026 · 2 filesMessage 78 · AdequateModerate 60Details
Commit message · Joost Jager

Fail held HTLCs on LSPS2 abandon

Drain queued intercepted HTLCs before removing pending LSPS2
JIT channel state in channel_open_abandoned. Add a real
interception regression test that verifies the held HTLC is no
longer pending after the abandon call.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
fuzzing or regression evidence
AI analysis · Moderate 60/100

This commit fixes a bug in the Lightning Dev Kit's LSPS2 (Just-In-Time channel) service. Previously, when a service provider abandoned a pending JIT channel open, any intercepted HTLCs (pending payment holds) waiting for that channel were left stuck in limbo instead of being properly failed backwards. The patch now drains the queued HTLCs and fails them before removing the channel state, preventing funds from being locked up and ensuring the payment sender receives a failure notification.

Lower-priorityRemove now-redundant PaymentParameters paramsby Valentine Wallace · d5d502a9 · Jun 17, 2026 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · Valentine Wallace

Remove now-redundant PaymentParameters params

In the last commit, we made Route::route_params required instead of an Option.
After this change, we can modify a few methods that took a Route in addition to
a separate PaymentParameters argument, since the pay params can always be
retrieved from the Route now.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This is a routine internal code cleanup in the Lightning Dev Kit's payment-sending logic. It removes a now-unnecessary duplicate argument from a few private functions because the same information is already stored inside the Route object. There is no user-facing change and no security fix.

Security candidateRequire Route::route_paramsby Valentine Wallace · 41f0809a · Jun 17, 2026 · 13 filesMessage 58 · ThinInformational 22Details
Commit message · Valentine Wallace

Require Route::route_params

This field has always been set since 0.0.117. Since we're making it required
here, routes created/serialized prior to 0.0.117 will fail to deserialize on
0.4.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
Why it was queued
boot or update path
AI analysis · Informational 22/100

This commit makes a piece of routing data called route_params mandatory in the Lightning Dev Kit library. Previously it was optional, and the code would silently invent a dummy value if it was missing. Now it must always be provided, and old serialized routes written before version 0.0.117 will fail to load. This is a deliberate backwards-compatibility break, not a security fix, and it reduces the risk of inconsistent or missing routing information rather than introducing a vulnerability.

Lower-priorityRustfmt send_payment_with_routeby Valentine Wallace · e90ab9d2 · Jun 17, 2026 · 1 fileMessage 40 · ThinInformational 15Details
Commit message · Valentine Wallace

Rustfmt send_payment_with_route

About to modify this method slightly, so opportunistically format it now.

40/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides an explanatory body! Too few words to establish purpose
AI analysis · Informational 15/100

This commit is purely a formatting cleanup: it removes a 'skip rustfmt' marker and re-indents a function so the code is easier to read. No behavior, logic, or security properties of the payment-sending code were changed.

AI review queuedFix invalid dummy pubkey in send_to_routeby Valentine Wallace · 54cdd85f · Jun 17, 2026 · 1 fileMessage 80 · StrongLow 44Details
Commit message · Valentine Wallace

Fix invalid dummy pubkey in send_to_route

If a caller of send_payment_with_route provided a route with either no paths,
or where the first path had 0 hops, the method would panic due to attempting to
unwrap a dummy pubkey that was initialized with 32 bytes instead of the
required 33.

Reported by Project Loupe.

80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
second-pass: broader security terminology
AI analysis · Low 44/100

This commit fixes a programming bug in rust-lightning's send_to_route function. When a user supplied a payment route with no paths or an empty first path, the code tried to create a fallback 'dummy' public key using 32 bytes of data, but public keys require 33 bytes. That mismatch caused the program to panic and crash. The fix simply changes the dummy data to 33 bytes so the fallback public key is valid and the unwrap succeeds. It is a denial-of-service/crash bug, not a theft-of-funds vulnerability, because the panic aborts the operation rather than letting an attacker manipulate funds.

Lower-priorityAdd pending changelog entry for PR 4656by Elias Rohrer · 8270c7cd · Jun 17, 2026 · 1 fileMessage 45 · ThinInformational 15Details
Commit message · Elias Rohrer

Add pending changelog entry for PR 4656

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
documentation-only discount
AI analysis · Informational 15/100

This commit only adds a pending changelog entry describing an API change in a previous pull request. It contains no code changes, no bug fixes, and no security-related content.

AI review queuedCorrect deserialization of `u16::MAX` byte-Featuresby Matt Corallo · 87c8c326 · Jun 17, 2026 · 1 fileMessage 73 · AdequateLow 38Details
Commit message · Matt Corallo

Correct deserialization of `u16::MAX` byte-Features

This shouldn't really matter in practice, but it aligns the
serialization and deserialization logic.

Reported by Project Loupe.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
second-pass: broader security terminology
AI analysis · Low 38/100

This commit fixes a mismatch in how Lightning feature flags are read from the wire. Previously, a feature set whose serialized byte length was exactly 65,535 bytes (u16::MAX) could be deserialized incorrectly because the code used a generic vector reader that may interpret the length differently. The fix reads the length as a u16 and then reads exactly that many bytes, matching the write side. The commit message says this 'shouldn't really matter in practice.'

Lower-priorityRefuse to set features at index higher than `u16::MAX` bytesby Matt Corallo · 4cd3a8a6 · Jun 17, 2026 · 1 fileMessage 65 · AdequateLow 35Details
Commit message · Matt Corallo

Refuse to set features at index higher than `u16::MAX` bytes

These aren't serialize-able and clearly bogus.

Reported by Project Loupe

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Low 35/100

This commit adds a safety check in the code that handles Lightning network feature flags. Feature flags are small on/off settings used when two nodes connect. The change prevents the code from accepting a feature flag position so high that it would require more than 65,535 bytes to store. Such huge positions cannot be serialized to the network format, so they are now rejected as invalid. The commit message says the issue was reported by Project Loupe.

AI review queuedDon't panic when a composite sub-handler returns `Ok(None)`by Jeffrey Czyz · 77ac339b · Jun 17, 2026 · 1 fileMessage 73 · AdequateHigh 76Details
Commit message · Jeffrey Czyz

Don't panic when a composite sub-handler returns `Ok(None)`

A handler built with `composite_custom_message_handler!` routes an incoming
message type to the sub-handler whose pattern matches it and assumed the
sub-handler would always decode it. But per the `CustomMessageReader`
contract a sub-handler returns `Ok(None)` for a type it doesn't recognize,
and a sub-handler's pattern -- a range in particular -- can be broader than
the types it actually decodes.

Since the message type comes from peer input, this let a remote peer panic
the message-processing thread with a single custom message whose type falls
in a sub-handler's pattern but isn't decoded by it. Report such a message as
unknown instead, matching how `wire::do_read` handles an undecoded custom
message.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
second-pass: broader security terminology
AI analysis · High 76/100

This commit fixes a bug where a remote peer could crash a Lightning node by sending a specially chosen custom message. The crash happened because a message-routing helper assumed a sub-component would always recognize any message type matching its declared pattern, but sub-components can legitimately decline to decode some types within their pattern. The fix replaces an internal 'this should never happen' crash with a graceful 'unknown message' response.

Lower-priorityAdd LSPS2 replay regression coverageby tnull · 68e71c2f · Jun 17, 2026 · 1 fileMessage 78 · AdequateLow 29Details
Commit message · tnull

Add LSPS2 replay regression coverage

Persisting LSPS2 service state can race with replayed intercepted HTLC
events after restart. Cover replaying the same intercepted HTLC after
restoring peer state so duplicate queueing is caught.

Co-Authored-By: HAL 9000

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Low 29/100

This commit adds a new regression test for the LSPS2 (Lightning Service Provider Specification 2) feature in rust-lightning. It checks that if a node crashes and restarts, replaying the same intercepted payment event does not cause the service to accidentally queue or process the payment twice. The test ensures that after restoring saved peer state, replaying an already-seen HTLC returns no action, and the payment is still forwarded correctly once the channel is ready. There is no code fix here—only a new test to catch a past or potential duplicate-queueing bug.

Lower-priorityPrune closed LSPS2 terminal channel stateby tnull · bab66f62 · Jun 17, 2026 · 2 filesMessage 68 · AdequateInformational 24Details
Commit message · tnull

Prune closed LSPS2 terminal channel state

Terminal JIT channel state is only useful while the forwarded channel
still exists. Drop completed LSPS2 mappings once the channel is gone so
persisted service state does not retain stale entries indefinitely.

Co-Authored-By: HAL 9000

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 24/100

This commit adds cleanup logic for a Lightning Service Provider (LSP) feature called LSPS2 Just-In-Time (JIT) channels. When a JIT channel closes, the service now deletes leftover internal tracking entries instead of keeping them forever in persistent storage. The change is framed as a state-management hygiene fix rather than an active vulnerability patch. It does not appear to fix a remotely triggerable exploit, but stale state could theoretically lead to confusion, incorrect reuse of old channel identifiers, or unbounded growth of stored data over time.

AI review queuedTreat replayed LSPS2 HTLCs idempotentlyby tnull · 6997c888 · Jun 17, 2026 · 1 fileMessage 68 · AdequateLow 44Details
Commit message · tnull

Treat replayed LSPS2 HTLCs idempotently

Replayed intercepted HTLC events should not duplicate queued payments or
panic after restart. Ignore already-queued intercept IDs so persisted
queues remain stable across event replay.

Co-Authored-By: HAL 9000

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
second-pass: broader security terminology
AI analysis · Low 44/100

This change fixes a crash and duplicate-queue bug in the Lightning Dev Kit's LSPS2 payment queue. After a restart, previously seen intercepted HTLCs can be replayed; the old code would panic (in debug builds) or add duplicates, while the new code returns the existing payment status instead. It is a reliability/idempotency fix rather than a direct theft-of-funds vulnerability, but a panic on restart could disrupt a liquidity service.