mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 09:27:39 +00:00
fix(security): harden SSH target handling (#4001)
Thanks @YLChen-007. Co-authored-by: Edward-x <YLChen-007@users.noreply.github.com>
This commit is contained in:
@@ -107,7 +107,9 @@ export async function gatewayStatusCommand(
|
||||
const base = user ? `${user}@${host.trim()}` : host.trim();
|
||||
return sshPort !== 22 ? `${base}:${sshPort}` : base;
|
||||
})
|
||||
.filter((x): x is string => Boolean(x));
|
||||
.filter((candidate): candidate is string =>
|
||||
Boolean(candidate && parseSshTarget(candidate)),
|
||||
);
|
||||
if (candidates.length > 0) sshTarget = candidates[0] ?? null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user