Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security] Elevation of privilege over loopback #680

Closed
manojampalam opened this issue Apr 20, 2017 · 5 comments
Closed

[Security] Elevation of privilege over loopback #680

manojampalam opened this issue Apr 20, 2017 · 5 comments

Comments

@manojampalam
Copy link
Contributor

manojampalam commented Apr 20, 2017

Please answer the following

"OpenSSH for Windows" version
0.0.12.0

OS details
All

What is failing
Elevation of privilege in the following setting:

  • SSO setup for admin user with both client and server on the same box.
  • User private key registered in ssh-agent and user's public key added as authorized for key-based auth

Malware running within an admin non-evelated session and create a ssh remote session over loopback (or to local IP) and can access an elevated remote ssh session on the same box.

Expected output
SSH remote sessions created with SSO over loopback should have no more privileges than client process.

Actual output
SSh remote sessions are elevated.

@manojampalam
Copy link
Contributor Author

manojampalam commented Apr 20, 2017

Mitigation:
Above setup (client and server on the same box) is not of practical use. Avoid such setup.
Write tools that can identify and warn of such configuration vulnerabilities.

@keiyakins
Copy link

keiyakins commented Jul 26, 2018

That mitigation is absurd. It's quite normal to have both ssh and sshd on a single system. Pretty much every 'nix system I've ever set up works that way. Windows needs to catch up to the 80s.

The problem is in how elevation works. You should be elevating per-command not for the entire shell.

@davidvmckay
Copy link

Couldn't this be avoided by ensuring that the keys used for the client are incompatible with the keys used for the server?

@Jaykul
Copy link

Jaykul commented Oct 2, 2018

Please don't focus on the loopback aspect of this. The problem is not the fact that users can loopback. The problem is if the user connects to an elevated session. Period. Full Stop.

Any attempt to address this by preventing loopback will break things that should work, and would not substantially mitigate the problem (the attacker would just need to connect out and then back in).

Outside of Windows, a user connecting via SSH is not be connected to an elevated session even if they have sudoer/administrator rights. They need to elevate individual commands (including, perhaps, launching an elevated shell) after they're connected, using sudo and their password...

@manojampalam manojampalam removed this from the Beta milestone May 21, 2019
@maertendMSFT
Copy link
Collaborator

The correct solution requires support of sudo in Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants
@keiyakins @Jaykul @davidvmckay @manojampalam @maertendMSFT and others