Skip to content

wsl2: validate guest-reported address in getSSHAddress - #5405

Open
SABITHSAHEB wants to merge 1 commit into
lima-vm:masterfrom
SABITHSAHEB:wsl2-ssh-address-validate
Open

wsl2: validate guest-reported address in getSSHAddress#5405
SABITHSAHEB wants to merge 1 commit into
lima-vm:masterfrom
SABITHSAHEB:wsl2-ssh-address-validate

Conversation

@SABITHSAHEB

Copy link
Copy Markdown
Contributor
  1. getSSHAddress reads the instance address from commands run inside the guest (hostname -I | cut, ip route get 1 | awk); only the fallback branch checked the output was an IP, the first two returned it verbatim.
  2. shell.go and tunnel.go pass inst.SSHAddress to ssh as a positional argument before --, so a compromised guest returning -oProxyCommand=<cmd> has it parsed as an ssh option and run on the host (a plain hostname just points the host's ssh/scp/rsync, which use StrictHostKeyChecking=no, at an endpoint the guest picks).

Route all three branches through one helper that returns the value only when it is a routable, non-loopback IP, matching what the fallback already required.

Signed-off-by: Sabith Saheb <shabi7204192361@gmail.com>
@SABITHSAHEB

Copy link
Copy Markdown
Contributor Author

any update?

@AkihiroSuda
AkihiroSuda requested a review from jandubois August 25, 2026 15:49
@AkihiroSuda AkihiroSuda added this to the v2.3.0 milestone Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants