4 ms·
Neat idea, but I think there's a confused deputy(?) attack possible here. Specifically, I think there's a missing binding between the SSH session used for auth
by dlitz 11y ago
Neat idea, but I think there's a confused deputy(?) attack possible here.
Specifically, I think there's a missing binding between the SSH session used for authentication and a user's web session.
Let's say that Alice has an account on bob.com. Mallory sets up mallory.net and sets up demo-ssh.mallory.net as a DNS alias (or TCP proxy) pointing to demo-ssh.bob.com.
1. Alice visits mallory.net, which Mallory controls
2. Mallory visits bob.com and starts an authentication session.
3. bob.com presents an SSH challenge to Mallory
ssh demo-ssh.bob.com -l 7d7662f63f70de7714 -p 2222
4. Mallory forwards the challenge from bob.com to Alice, optionally substituting their own hostname:
ssh demo-ssh.mallory.net -l 7d7662f63f70de7714 -p 2222
5. Alice runs the command to authenticate to "demo-ssh.mallory.net". But this actually authenticates Mallory as Alice to bob.com!
6. Upon detecting a successful login, mallory.net accepts Alice's login to avoid raising suspicion.
The only sure sign that this has happened would be that demo-ssh.bob.com and demo-ssh.mallory.net would have the same host keys, but OpenSSH isn't designed to prohibit duplicate host keys.
- dlitz 11y agoOne potential way to solve this would be to include the origin in the challenge, which the server could check: ssh demo-ssh.bob.com -l 7d7662f63f70de7714 -p 2222 https://www.bob.com Mallory's attack then would have the possibility of being detected: ssh demo-ssh.mallory.net -l 7d7662f63f70de7714 -p 2222 https://www.bob.com However, this still relies on the user manually checking the origin of the challenge every single time, and users aren't very reliable. It might be better suited to a browser extension than to a manual copy-and-paste process.