reckless: fail reckless rpc if executable fails
What changed, and why it matters
This commit fixes a bug in Core Lightning's 'reckless' plugin command. Previously, if the external 'reckless' program could not be launched (for example, because it was missing from the system PATH), the RPC command would hang indefinitely instead of reporting an error. The patch makes the plugin return a clear failure message when the program cannot be executed.
Treat as a routine bug fix. No urgent security response is indicated, but include in release notes because it resolves a user-visible hang.
Security signals we found
Denial-of-service-like hang on missing external dependency
Error-path handling improvement
No input validation, authentication, or cryptographic changes
Evidence from the diff
In plugins/recklessrpc.c, reckless_call() launches an external ‘reckless’ binary via pipecmdarr(). The old code had a FIXME noting it should handle an invalid pid, but did nothing, so on failure the command would remain stuck waiting for I/O callbacks that would never fire. The patch checks if reckless->pid < 0 and immediately returns command_fail(cmd, LIGHTNINGD, “reckless failed: %s”, strerror(errno)). This is a reliability/DoS-class fix, not a memory-safety or authentication bug.
Changed components
plugins/recklessrpc.creckless JSON-RPC commandInspect captured patch +5 / −1
diff --git a/plugins/recklessrpc.c b/plugins/recklessrpc.c
index 510a3e55..5d3ebb5b 100644
--- a/plugins/recklessrpc.c
+++ b/plugins/recklessrpc.c
@@ -256,7 +256,11 @@ static struct command_result *reckless_call(struct command *cmd,
reckless->pid = pipecmdarr(&reckless->stdinfd, &reckless->stdoutfd,
&reckless->stderrfd, my_call);
- /* FIXME: fail if invalid pid*/
+ if (reckless->pid < 0) {
+ return command_fail(cmd, LIGHTNINGD, "reckless failed: %s",
+ strerror(errno));
+ }
+
io_new_conn(reckless, reckless->stdoutfd, conn_init, reckless);
io_new_conn(reckless, reckless->stderrfd, stderr_conn_init, reckless);
tal_free(my_call);
Why this scored 21/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.