lsp_plugin: change extra_fee value type to u64
What changed, and why it matters
This is a one-line type correction in a Lightning plugin. The code now reads an unsigned 64-bit integer (u64) instead of a truncated unsigned 64-bit integer (tu64) when fetching the optional 'extra_fee' amount from custom TLV data. The change aligns the implementation with BLIP-25's specification and is best understood as a protocol-compliance fix, not a security patch. There is no direct evidence in the commit or supplied references that this fixes an exploitable vulnerability.
Treat as a normal spec-compliance fix. Review whether the previous truncated-decoder behavior could cause any operational or fee-handling edge cases, but no urgent security response is indicated by this commit alone.
Security signals we found
Type change from truncated TLV decoder to full TLV decoder
Reference to external protocol spec (BLIP-25) in commit message
No mention of security, CVE, vulnerability, or researcher attribution
Single-line change in plugin code only
Evidence from the diff
In plugins/lsps-plugin/src/client.rs, the on_htlc_accepted handler changes extra_tlvs.get_tu64(65537) to extra_tlvs.get_u64(65537). ‘tu64’ is Core Lightning’s type for a truncated u64 TLV encoding, while ‘u64’ is the full-length encoding. BLIP-25 specifies amount_msat inside extra_fee as a full u64. The previous code would therefore fail to decode a spec-compliant extra_fee TLV, likely returning None and logging a warning rather than processing the fee. This is a correctness/spec-compliance change; it does not, on its own, indicate a memory-safety bug, overflow, or bypass.
Changed components
plugins/lsps-plugin/src/client.rsLSPS (Lightning Service Provider Spec) client pluginon_htlc_accepted handlerInspect captured patch +1 / −1
diff --git a/plugins/lsps-plugin/src/client.rs b/plugins/lsps-plugin/src/client.rs
index 98f39595..f23f8ec7 100644
--- a/plugins/lsps-plugin/src/client.rs
+++ b/plugins/lsps-plugin/src/client.rs
@@ -445,7 +445,7 @@ async fn on_htlc_accepted(
// Safe unwrap(): we already checked that `extra_tlvs` exists.
let extra_tlvs = req.htlc.extra_tlvs.unwrap();
- let deducted_amt = match extra_tlvs.get_tu64(65537)? {
+ let deducted_amt = match extra_tlvs.get_u64(65537)? {
Some(amt) => amt,
None => {
warn!("htlc is missing the extra_fee amount");
Why this scored 12/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.