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

cln-grpc: reject malformed request values instead of panicking

Public commit record

What the developer wrote

Authored by daywalker90

73/100 · Adequate
cln-grpc: reject malformed request values instead of panicking

The msggen-generated inbound conversions parsed client-controlled pubkeys, hashes, secrets, short channel ids and enum values with unwrap(), so malformed requests could panic the tonic worker task. The hand-written ProofField conversion called std::process::exit(1) when its oneof was missing, killing the plugin, and narrowing u16 fields were silently truncated by `as` casts.

Generate TryFrom impls that return tonic::Status, map parse failures, missing required fields and out-of-range numbers to INVALID_ARGUMENT, and propagate the errors from the server handlers.

Changelog-Fixed: cln-grpc no longer panics on malformed request values.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a security bug in Core Lightning's gRPC plugin (cln-grpc). Previously, a malformed request from a gRPC client could crash the plugin: bad public keys, hashes, secrets, channel IDs, or enum values triggered Rust 'unwrap()' panics, a missing 'oneof' field caused the plugin to call process::exit(1) and shut down, and large numbers were silently truncated when stored as smaller integer types. The patch replaces these crash-prone conversions with fallible TryFrom implementations that return a proper INVALID_ARGUMENT error to the client instead of crashing or killing the plugin.

Recommended action

Upgrade to a Core Lightning release containing this commit. If running an older version with cln-grpc exposed to untrusted or partially trusted clients, restrict gRPC access until patched, and monitor for plugin restarts or tonic worker panics.

Security signals we found

01

Denial-of-service via malformed gRPC request causing tonic worker task panic

02

Denial-of-service via std::process::exit(1) in ProofField conversion on missing oneof

03

Silent integer truncation of u16/u8 fields via 'as' casts

04

Client-controlled input parsed with unwrap() on pubkeys, hashes, secrets, SCIDs, enums

05

Patch converts From to TryFrom and propagates tonic::Status::invalid_argument errors

Risk score

Why this scored 74/100

Our methodology →
Potential impact 22/30
Exploitability 18/25
Stealth signal 8/15
Affected reach 12/15
Confidence 9/10
Evidence quality 5/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.