From 7632cfe5174ecaaea1c8d3b711b44cbcd87ec506 Mon Sep 17 00:00:00 2001 From: Valentine Wallace Date: Tue, 12 Sep 2023 14:56:54 -0400 Subject: [PATCH] Refuse to pathfind when provided our_node_id matches internal dummy pk The fuzzer managed to hit this and it causes some invalid paths to be generated internally. --- lightning/src/routing/router.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index 184e3bcd8..53bd92434 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -1489,6 +1489,9 @@ where L::Target: Logger { if payee_node_id_opt.map_or(false, |payee| payee == our_node_id) { return Err(LightningError{err: "Cannot generate a route to ourselves".to_owned(), action: ErrorAction::IgnoreError}); } + if our_node_id == maybe_dummy_payee_node_id { + return Err(LightningError{err: "Invalid origin node id provided, use a different one".to_owned(), action: ErrorAction::IgnoreError}); + } if final_value_msat > MAX_VALUE_MSAT { return Err(LightningError{err: "Cannot generate a route of more value than all existing satoshis".to_owned(), action: ErrorAction::IgnoreError}); -- 2.39.5