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

tests: huge log entries don't crash lightningd

Public commit record

What the developer wrote

Authored by daywalker90

78/100 · Adequate
tests: huge log entries don't crash lightningd

Drive log_to_files() directly with an entry far larger than any stack buffer,
using a plugin which emits one on demand.

Nothing bounds a log entry, so testing this through clnrest is the wrong shape:
requests are now capped at 2MiB before any parameter is parsed, so an oversized
request is rejected long before it can reach the logger, and a test written that
way passes whether or not the daemon is fixed. A plugin can hand us an entry of
any size, which is what we actually want to exercise.

(cherry picked from commit 50910c956694006b516b8bca1dbc214f79842772)
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit adds a test for a previously fixed crash in Core Lightning's logging code. The bug was that log entries could be arbitrarily large, and the daemon used to allocate a stack buffer based on the entry's length, which could exhaust the stack and crash the process. The test uses a plugin to feed the logger an 8 MB entry and checks the node stays alive. The commit itself only adds the test and plugin; it does not contain the actual fix.

Recommended action

Verify that the actual fix for log_to_files() (removing variable-length stack allocation or bounding/copying the entry safely) is present in the branch containing this cherry-pick. The test alone does not fix the vulnerability. If the fix is missing, backport or apply it before relying on this test for security assurance.

Security signals we found

01

Stack-based variable-length array in log_to_files() described in commit message

02

Potential denial-of-service via oversized log entry from plugin or attacker-influenced subsystem

03

Test exercises 8 MiB single-line log entry to verify daemon does not crash

04

Commit message explicitly frames issue as security-relevant ('attacker-influenced data')

05

Cherry-pick of commit 50910c956694006b516b8bca1dbc214f79842772 suggests backport to stable branch

Risk score

Why this scored 64/100

Our methodology →
Potential impact 18/30
Exploitability 14/25
Stealth signal 10/15
Affected reach 12/15
Confidence 7/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.