AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 23 Bitcoin

plugins/libplugin-pay: Add a check for NaN values

Public commit record

What the developer wrote

Authored by Chandra Pratap

80/100 · Strong
plugins/libplugin-pay: Add a check for NaN values

Changelog-Fixed: Due to the imprecision of `htlc_max`'s type (`fp16_t`),
`capacity_bias()` can return `NaN` in some cases. This leads to a
runtime error when compiled with UBSan. Add a check against it.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit fixes a rare numerical edge case in Core Lightning's payment routing plugin. A calculation that estimates route capacity could, in some situations, produce a special 'not a number' (NaN) value because of the imprecise half-precision floating-point type used for channel capacity limits. The patch adds a guard so that if the result is NaN, it is treated as an out-of-range score and clamped to a safe maximum. The practical security impact appears low: it only affects local route scoring, and the commit message frames it as fixing a runtime error under Undefined Behavior Sanitizer rather than an exploitable vulnerability.

Recommended action

Apply the patch. It is a minimal, defensive fix. No immediate incident response is warranted unless further analysis shows that a NaN route score can be triggered by an attacker-controlled channel announcement to systematically bias routing.

Security signals we found

01

Fixes undefined-behavior sanitizer (UBSan) runtime error

02

Adds NaN check on floating-point score before integer cast

03

Score is used in payment routing decisions, so NaN could distort path selection

04

No explicit security claim or CVE in commit message

Risk score

Why this scored 23/100

Our methodology →
Potential impact 4/30
Exploitability 2/25
Stealth signal 3/15
Affected reach 5/15
Confidence 6/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.