Skip to content

Commit 7256968

Browse files
committed
MB-49705 [BP] Don't leak sensitive information (complete_join)
Prior to this change a crash while doing an engage_cluster could leak sensitive information such as PRIVATE KEYs. We know wrap the list of arguments used by engage_cluster in a function and pass the function instead. This is a backport of MB-48222. Change-Id: I30ac0c0f4a6c5542519619328dc21981bdb81de6 Reviewed-on: https://review.couchbase.org/c/ns_server/+/172373 Well-Formed: Build Bot <[email protected]> Well-Formed: Restriction Checker Reviewed-by: Bryan McCoid <[email protected]> Tested-by: Steve Watanabe <[email protected]>
1 parent 4a54f7b commit 7256968

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ns_cluster.erl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,9 @@ call_engage_cluster(NodeKVList) ->
298298
?ENGAGE_TIMEOUT).
299299

300300
complete_join(NodeKVList) ->
301-
gen_server:call(?MODULE, {complete_join, NodeKVList}, ?COMPLETE_TIMEOUT).
301+
NodeKVListThunk = fun () -> NodeKVList end,
302+
gen_server:call(?MODULE, {complete_join, NodeKVListThunk},
303+
?COMPLETE_TIMEOUT).
302304

303305
multi_call(Nodes, Call, Timeout) ->
304306
{_Replies, BadNodes} =
@@ -416,7 +418,8 @@ handle_call({engage_cluster, NodeKVListThunk}, _From, State) ->
416418
?cluster_debug("engage_cluster(..) -> ~p", [RV]),
417419
{reply, RV, State};
418420

419-
handle_call({complete_join, NodeKVList}, _From, State) ->
421+
handle_call({complete_join, NodeKVListThunk}, _From, State) ->
422+
NodeKVList = NodeKVListThunk(),
420423
?cluster_debug("handling complete_join(~p)", [sanitize_node_info(NodeKVList)]),
421424
RV = do_complete_join(NodeKVList),
422425
?cluster_debug("complete_join(~p) -> ~p", [sanitize_node_info(NodeKVList), RV]),

0 commit comments

Comments
 (0)