Blinded path payloads don't reject unknown TLVs per BOLT4

未关闭
#4,442 7 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

  • #4546 来自 @officialasishkumar —— 已关闭,未合并

评估

难度
4/5
预计耗时
3-5 天
新手友好度
32/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
rust

调研方向

Start from the TLV decode path cited in the issue (lightning/src/util/ser_macros.rs around the odd/even check) and BlindedReceive handling in msgs.rs. Compare intermediate vs final blinded-path allowlists in BOLT4. There is a closed unmerged PR (#4546); read that thread before duplicating work. Done means unknown TLVs are rejected as specified and existing onion/TLV tests cover both node roles.

由索引模型根据 Issue 内容生成。

描述

backport 0.1 backport 0.2

BOLT4 requires strict TLV allowlisting for blinded paths, but rust-lightning uses the standard odd/even rule (ignore unknown odd TLVs).

BOLT4 Requirements: (https://github.com/lightning/bolts/blob/master/04-onion-routing.md#requirements)

Intermediate nodes: MUST reject payloads containing TLVs other than encrypted_recipient_data and current_path_key. (https://github.com/lightning/bolts/blob/8f2908b56363927e167e7235d4a9d191c1bd2aa8/04-onion-routing.md?plain=1#L314C6-L315C126)

Final nodes: MUST reject payloads containing TLVs other than encrypted_recipient_data, current_path_key, amt_to_forward, outgoing_cltv_value, and total_amount_msat. (https://github.com/lightning/bolts/blob/8f2908b56363927e167e7235d4a9d191c1bd2aa8/04-onion-routing.md?plain=1#L322)

Current Behavior:

lightning/src/util/ser_macros.rs:687-689:

if t % 2 == 0 {
    return Err(DecodeError::UnknownRequiredFeature);
}
// Unknown odd TLVs silently ignored instead of rejected

Additionally, BlindedReceive payloads accept custom TLVs >= 65536 (msgs.rs:3894-3900).

  • LND rejects blinded packets with extra TLVs (spec-compliant)
  • rust-lightning accepts them (non-compliant)

Found using differential fuzzing (bitcoinfuzz)

主要语言
Rust
星标
1.4k
派生
482
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

lightningdevkit/rust-lightning 的其他 Issue

查看 lightningdevkit/rust-lightning 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。