htlcswitch: validate intercepted auto-fail height #11028
🔴 PR Severity: CRITICAL
file-based classification | 3 files | 111 lines changed
<details>
<summary>🔴 <strong>Critical</strong> (1 file)</summary>
htlcswitch/interceptable_switch.go - HTLC forwarding/interception logic (auto-fail height validation for the interceptor API)</details>
<details>
<summary>🟢 <strong>Low</strong> (2 files)</summary>
htlcswitch/switch_test.go - test-only changedocs/release-notes/release-notes-0.21.2.md - release notes</details>
Analysis
The core change is in htlcswitch/interceptable_switch.go, which is part of the HTLC forwarding/payment routing state machine (severity-critical per package rules). The change validates the derived auto-fail height before exposing it through the interceptor API, guarding against out-of-range integer conversions. Although the diff is small (34 lines in the non-test source file) and well-covered by new tests, changes to this file touch HTLC forwarding correctness and warrant expert review of the interceptor semantics and BOLT compliance.
---
<sub>To override, add a severity-override-{critical,high,medium,low} label.</sub>
<!-- pr-severity-bot -->
LGTM🦺
LGTM! 🦺
Created backport PR for v0.20.x-branch:
Please cherry-pick the changes locally and resolve any conflicts.
git fetch origin backport-11028-to-v0.20.x-branch
git worktree add --checkout .worktree/backport-11028-to-v0.20.x-branch backport-11028-to-v0.20.x-branch
cd .worktree/backport-11028-to-v0.20.x-branch
git reset --hard HEAD^
git cherry-pick -x 4ccb2aa94a6273b8d24887c1bc4c7724690a4b9a
git push --force-with-lease
Successfully created backport PR for v0.21.x-branch:
yyforyongyu
ziggie1984
Change Description
This updates off-chain forward interception to validate the derived auto-fail
height before exposing it through the interceptor API. Heights outside the
supported
int32representation are returned with the BOLT-definedexpiry_too_farresponse.The incoming expiry and interceptor deadline use different integer
representations. Checking the range before conversion keeps the deadline in
the supported representation while leaving in-range handling unchanged.
The accompanying test covers both out-of-range and in-range forward handling.
Steps to Test
Pull Request Checklist
Testing
Code Style and Documentation