Skip to content

Commit 4a54f7b

Browse files
committed
MB-49705 [BP] Don't leak sensitive information (engage_cluster)
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: I5b268d525f6c58114fbe169d9ba7fc3f75845a9b Reviewed-on: https://review.couchbase.org/c/ns_server/+/172372 Well-Formed: Build Bot <[email protected]> Well-Formed: Restriction Checker Reviewed-by: Bryan McCoid <[email protected]> Tested-by: Steve Watanabe <[email protected]>
1 parent 33aec16 commit 4a54f7b

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
@@ -293,7 +293,9 @@ ensure_dist_ports_match(NodeKVList) ->
293293
end.
294294

295295
call_engage_cluster(NodeKVList) ->
296-
gen_server:call(?MODULE, {engage_cluster, NodeKVList}, ?ENGAGE_TIMEOUT).
296+
NodeKVListThunk = fun () -> NodeKVList end,
297+
gen_server:call(?MODULE, {engage_cluster, NodeKVListThunk},
298+
?ENGAGE_TIMEOUT).
297299

298300
complete_join(NodeKVList) ->
299301
gen_server:call(?MODULE, {complete_join, NodeKVList}, ?COMPLETE_TIMEOUT).
@@ -407,7 +409,8 @@ handle_call({add_node_to_group, Scheme, RemoteAddr, RestPort, Auth, GroupUUID,
407409
[Scheme, RemoteAddr, RestPort, GroupUUID, RV]),
408410
{reply, RV, State};
409411

410-
handle_call({engage_cluster, NodeKVList}, _From, State) ->
412+
handle_call({engage_cluster, NodeKVListThunk}, _From, State) ->
413+
NodeKVList = NodeKVListThunk(),
411414
?cluster_debug("handling engage_cluster(~p)", [sanitize_node_info(NodeKVList)]),
412415
RV = do_engage_cluster(NodeKVList),
413416
?cluster_debug("engage_cluster(..) -> ~p", [RV]),

0 commit comments

Comments
 (0)