Skip to content
Snippets Groups Projects
  • Simon Tatham's avatar
    1dc5659a
    New option to reject 'trivial' success of userauth. · 1dc5659a
    Simon Tatham authored
    Suggested by Manfred Kaiser, who also wrote most of this patch
    (although outlying parts, like documentation and SSH-1 support, are by
    me).
    
    This is a second line of defence against the kind of spoofing attacks
    in which a malicious or compromised SSH server rushes the client
    through the userauth phase of SSH without actually requiring any auth
    inputs (passwords or signatures or whatever), and then at the start of
    the connection phase it presents something like a spoof prompt,
    intended to be taken for part of userauth by the user but in fact with
    some more sinister purpose.
    
    Our existing line of defence against this is the trust sigil system,
    and as far as I know, that's still working. This option allows a bit of
    extra defence in depth: if you don't expect your SSH server to
    trivially accept authentication in the first place, then enabling this
    option will cause PuTTY to disconnect if it unexpectedly does so,
    without the user having to spot the presence or absence of a fiddly
    little sigil anywhere.
    
    Several types of authentication count as 'trivial'. The obvious one is
    the SSH-2 "none" method, which clients always try first so that the
    failure message will tell them what else they can try, and which a
    server can instead accept in order to authenticate you unconditionally.
    But there are two other ways to do it that we know of: one is to run
    keyboard-interactive authentication and send an empty INFO_REQUEST
    packet containing no actual prompts for the user, and another even
    weirder one is to send USERAUTH_SUCCESS in response to the user's
    preliminary *offer* of a public key (instead of sending the usual PK_OK
    to request an actual signature from the key).
    
    This new option detects all of those, by clearing the 'is_trivial_auth'
    flag only when we send some kind of substantive authentication response
    (be it a password, a k-i prompt response, a signature, or a GSSAPI
    token). So even if there's a further path through the userauth maze we
    haven't spotted, that somehow avoids sending anything substantive, this
    strategy should still pick it up.
    
    (cherry picked from commit 5f5c710c)
    1dc5659a
    History
    New option to reject 'trivial' success of userauth.
    Simon Tatham authored
    Suggested by Manfred Kaiser, who also wrote most of this patch
    (although outlying parts, like documentation and SSH-1 support, are by
    me).
    
    This is a second line of defence against the kind of spoofing attacks
    in which a malicious or compromised SSH server rushes the client
    through the userauth phase of SSH without actually requiring any auth
    inputs (passwords or signatures or whatever), and then at the start of
    the connection phase it presents something like a spoof prompt,
    intended to be taken for part of userauth by the user but in fact with
    some more sinister purpose.
    
    Our existing line of defence against this is the trust sigil system,
    and as far as I know, that's still working. This option allows a bit of
    extra defence in depth: if you don't expect your SSH server to
    trivially accept authentication in the first place, then enabling this
    option will cause PuTTY to disconnect if it unexpectedly does so,
    without the user having to spot the presence or absence of a fiddly
    little sigil anywhere.
    
    Several types of authentication count as 'trivial'. The obvious one is
    the SSH-2 "none" method, which clients always try first so that the
    failure message will tell them what else they can try, and which a
    server can instead accept in order to authenticate you unconditionally.
    But there are two other ways to do it that we know of: one is to run
    keyboard-interactive authentication and send an empty INFO_REQUEST
    packet containing no actual prompts for the user, and another even
    weirder one is to send USERAUTH_SUCCESS in response to the user's
    preliminary *offer* of a public key (instead of sending the usual PK_OK
    to request an actual signature from the key).
    
    This new option detects all of those, by clearing the 'is_trivial_auth'
    flag only when we send some kind of substantive authentication response
    (be it a password, a k-i prompt response, a signature, or a GSSAPI
    token). So even if there's a further path through the userauth maze we
    haven't spotted, that somehow avoids sending anything substantive, this
    strategy should still pick it up.
    
    (cherry picked from commit 5f5c710c)