What changed, and why it matters
This commit adds a new optional 'payer-note' field to the xpay RPC command in Core Lightning. It simply passes a user-provided note through to an underlying invoice-fetching call. There is no security issue visible in the change.
No security action required; review as normal feature addition.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch extends the xpay plugin’s parameter parsing to accept an optional ‘payer_note’ string and forwards it as a JSON string field in outgoing fetchinvoice/fetchbip353 requests. The value is handled via the standard param_string helper and json_add_string, with no parsing, allocation, or authorization changes that would suggest a vulnerability.
Changed components
plugins/xpay/xpay.cInspect captured patch +14 / −6
diff --git a/plugins/xpay/xpay.c b/plugins/xpay/xpay.c
index 43b381eb..9096bb48 100644
--- a/plugins/xpay/xpay.c
+++ b/plugins/xpay/xpay.c
@@ -181,7 +181,7 @@ static struct command_result *xpay_core(struct command *cmd,
u32 retryfor,
const struct amount_msat *partial,
u32 maxdelay,
- bool as_pay);
+ bool as_pay);
/* Wrapper for pending commands (ignores return) */
static void was_pending(const struct command_result *res)
@@ -1790,6 +1790,7 @@ struct xpay_params {
unsigned int retryfor;
u32 maxdelay;
const char *bip353;
+ const char *payer_note;
};
static struct command_result *
@@ -1820,9 +1821,12 @@ do_fetchinvoice(struct command *cmd, const char *offerstr, struct xpay_params *x
json_add_string(req->js, "offer", offerstr);
if (xparams->msat)
json_add_amount_msat(req->js, "amount_msat", *xparams->msat);
- if (xparams->bip353)
- json_add_string(req->js, "bip353", xparams->bip353);
- return send_outreq(req);
+ if (xparams->bip353)
+ json_add_string(req->js, "bip353", xparams->bip353);
+ if (xparams->payer_note)
+ json_add_string(req->js, "payer_note", xparams->payer_note);
+
+ return send_outreq(req);
}
static struct command_result *
@@ -1867,7 +1871,8 @@ static struct command_result *json_xpay_params(struct command *cmd,
const char *invstring;
const char **layers;
u32 *maxdelay;
- unsigned int *retryfor;
+ const char *payer_note;
+ unsigned int *retryfor;
struct out_req *req;
struct xpay_params *xparams;
@@ -1879,7 +1884,8 @@ static struct command_result *json_xpay_params(struct command *cmd,
p_opt_def("retry_for", param_number, &retryfor, 60),
p_opt("partial_msat", param_msat, &partial),
p_opt_def("maxdelay", param_u32, &maxdelay, 2016),
- NULL))
+ p_opt("payer_note", param_string, &payer_note),
+ NULL))
return command_param_failed();
/* Is this a one-shot vibe payment? Kids these days! */
@@ -1901,6 +1907,7 @@ static struct command_result *json_xpay_params(struct command *cmd,
xparams->retryfor = *retryfor;
xparams->maxdelay = *maxdelay;
xparams->bip353 = NULL;
+ xparams->payer_note = payer_note;
return do_fetchinvoice(cmd, invstring, xparams);
}
@@ -1915,6 +1922,7 @@ static struct command_result *json_xpay_params(struct command *cmd,
xparams->retryfor = *retryfor;
xparams->maxdelay = *maxdelay;
xparams->bip353 = invstring;
+ xparams->payer_note = payer_note;
req = jsonrpc_request_start(cmd, "fetchbip353",
bip353_fetched,
Why this scored 15/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.