draft-ietf-secsh-architecture-14.txt   draft-ietf-secsh-architecture-15.txt 
Network Working Group T. Ylonen Network Working Group T. Ylonen
Internet-Draft T. Kivinen Internet-Draft SSH Communications Security Corp
Expires: January 12, 2004 SSH Communications Security Corp Expires: March 31, 2004 D. Moffat, Ed.
M. Saarinen Sun Microsystems, Inc
University of Jyvaskyla Oct 2003
T. Rinne
S. Lehtinen
SSH Communications Security Corp
July 14, 2003
SSH Protocol Architecture SSH Protocol Architecture
draft-ietf-secsh-architecture-14.txt draft-ietf-secsh-architecture-15.txt
Status of this Memo Status of this Memo
This document is an Internet-Draft and is in full conformance with This document is an Internet-Draft and is in full conformance with
all provisions of Section 10 of RFC2026. all provisions of Section 10 of RFC2026.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that other
other groups may also distribute working documents as Internet- groups may also distribute working documents as Internet-Drafts.
Drafts.
Internet-Drafts are draft documents valid for a maximum of six Internet-Drafts are draft documents valid for a maximum of six months
months and may be updated, replaced, or obsoleted by other and may be updated, replaced, or obsoleted by other documents at any
documents at any time. It is inappropriate to use Internet-Drafts time. It is inappropriate to use Internet-Drafts as reference
as reference material or to cite them other than as "work in material or to cite them other than as "work in progress."
progress."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at http://
http://www.ietf.org/ietf/1id-abstracts.txt. www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on January 12, 2004. This Internet-Draft will expire on March 31, 2004.
Copyright Notice Copyright Notice
Copyright (C) The Internet Society (2003). All Rights Reserved. Copyright (C) The Internet Society (2003). All Rights Reserved.
Abstract Abstract
SSH is a protocol for secure remote login and other secure network SSH is a protocol for secure remote login and other secure network
services over an insecure network. This document describes the services over an insecure network. This document describes the
architecture of the SSH protocol, as well as the notation and architecture of the SSH protocol, as well as the notation and
terminology used in SSH protocol documents. It also discusses the terminology used in SSH protocol documents. It also discusses the SSH
SSH algorithm naming system that allows local extensions. The SSH algorithm naming system that allows local extensions. The SSH
protocol consists of three major components: The Transport Layer protocol consists of three major components: The Transport Layer
Protocol provides server authentication, confidentiality, and Protocol provides server authentication, confidentiality, and
integrity with perfect forward secrecy. The User Authentication integrity with perfect forward secrecy. The User Authentication
Protocol authenticates the client to the server. The Connection Protocol authenticates the client to the server. The Connection
Protocol multiplexes the encrypted tunnel into several logical Protocol multiplexes the encrypted tunnel into several logical
channels. Details of these protocols are described in separate channels. Details of these protocols are described in separate
documents. documents.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 1. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Specification of Requirements . . . . . . . . . . . . . . . 4 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
3. Architecture . . . . . . . . . . . . . . . . . . . . . . . . 4 3. Specification of Requirements . . . . . . . . . . . . . . . 3
3.1 Host Keys . . . . . . . . . . . . . . . . . . . . . . . . . 4 4. Architecture . . . . . . . . . . . . . . . . . . . . . . . . 3
3.2 Extensibility . . . . . . . . . . . . . . . . . . . . . . . 6 4.1 Host Keys . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.3 Policy Issues . . . . . . . . . . . . . . . . . . . . . . . 6 4.2 Extensibility . . . . . . . . . . . . . . . . . . . . . . . 5
3.4 Security Properties . . . . . . . . . . . . . . . . . . . . 7 4.3 Policy Issues . . . . . . . . . . . . . . . . . . . . . . . 5
3.5 Packet Size and Overhead . . . . . . . . . . . . . . . . . . 7 4.4 Security Properties . . . . . . . . . . . . . . . . . . . . 6
3.6 Localization and Character Set Support . . . . . . . . . . . 8 4.5 Packet Size and Overhead . . . . . . . . . . . . . . . . . . 6
4. Data Type Representations Used in the SSH Protocols . . . . 9 4.6 Localization and Character Set Support . . . . . . . . . . . 7
5. Algorithm Naming . . . . . . . . . . . . . . . . . . . . . . 11 5. Data Type Representations Used in the SSH Protocols . . . . 8
6. Message Numbers . . . . . . . . . . . . . . . . . . . . . . 12 6. Algorithm Naming . . . . . . . . . . . . . . . . . . . . . . 10
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . 12 7. Message Numbers . . . . . . . . . . . . . . . . . . . . . . 11
8. Security Considerations . . . . . . . . . . . . . . . . . . 13 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . 11
8.1 Pseudo-Random Number Generation . . . . . . . . . . . . . . 13 9. Security Considerations . . . . . . . . . . . . . . . . . . 12
8.2 Transport . . . . . . . . . . . . . . . . . . . . . . . . . 14 9.1 Pseudo-Random Number Generation . . . . . . . . . . . . . . 12
8.2.1 Confidentiality . . . . . . . . . . . . . . . . . . . . . . 14 9.2 Transport . . . . . . . . . . . . . . . . . . . . . . . . . 13
8.2.2 Data Integrity . . . . . . . . . . . . . . . . . . . . . . . 17 9.2.1 Confidentiality . . . . . . . . . . . . . . . . . . . . . . 13
8.2.3 Replay . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 9.2.2 Data Integrity . . . . . . . . . . . . . . . . . . . . . . . 16
8.2.4 Man-in-the-middle . . . . . . . . . . . . . . . . . . . . . 18 9.2.3 Replay . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
8.2.5 Denial-of-service . . . . . . . . . . . . . . . . . . . . . 20 9.2.4 Man-in-the-middle . . . . . . . . . . . . . . . . . . . . . 17
8.2.6 Covert Channels . . . . . . . . . . . . . . . . . . . . . . 21 9.2.5 Denial-of-service . . . . . . . . . . . . . . . . . . . . . 19
8.2.7 Forward Secrecy . . . . . . . . . . . . . . . . . . . . . . 21 9.2.6 Covert Channels . . . . . . . . . . . . . . . . . . . . . . 19
8.3 Authentication Protocol . . . . . . . . . . . . . . . . . . 21 9.2.7 Forward Secrecy . . . . . . . . . . . . . . . . . . . . . . 20
8.3.1 Weak Transport . . . . . . . . . . . . . . . . . . . . . . . 22 9.3 Authentication Protocol . . . . . . . . . . . . . . . . . . 20
8.3.2 Debug messages . . . . . . . . . . . . . . . . . . . . . . . 22 9.3.1 Weak Transport . . . . . . . . . . . . . . . . . . . . . . . 21
8.3.3 Local security policy . . . . . . . . . . . . . . . . . . . 23 9.3.2 Debug messages . . . . . . . . . . . . . . . . . . . . . . . 21
8.3.4 Public key authentication . . . . . . . . . . . . . . . . . 23 9.3.3 Local security policy . . . . . . . . . . . . . . . . . . . 21
8.3.5 Password authentication . . . . . . . . . . . . . . . . . . 24 9.3.4 Public key authentication . . . . . . . . . . . . . . . . . 22
8.3.6 Host based authentication . . . . . . . . . . . . . . . . . 24 9.3.5 Password authentication . . . . . . . . . . . . . . . . . . 22
8.4 Connection protocol . . . . . . . . . . . . . . . . . . . . 24 9.3.6 Host based authentication . . . . . . . . . . . . . . . . . 23
8.4.1 End point security . . . . . . . . . . . . . . . . . . . . . 24 9.4 Connection protocol . . . . . . . . . . . . . . . . . . . . 23
8.4.2 Proxy forwarding . . . . . . . . . . . . . . . . . . . . . . 24 9.4.1 End point security . . . . . . . . . . . . . . . . . . . . . 23
8.4.3 X11 forwarding . . . . . . . . . . . . . . . . . . . . . . . 25 9.4.2 Proxy forwarding . . . . . . . . . . . . . . . . . . . . . . 23
9. Intellectual Property . . . . . . . . . . . . . . . . . . . 25 9.4.3 X11 forwarding . . . . . . . . . . . . . . . . . . . . . . . 24
10. Additional Information . . . . . . . . . . . . . . . . . . . 26 Normative References . . . . . . . . . . . . . . . . . . . . 24
References . . . . . . . . . . . . . . . . . . . . . . . . . 26 Informative References . . . . . . . . . . . . . . . . . . . 25
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 29 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 27
Full Copyright Statement . . . . . . . . . . . . . . . . . . 31 Intellectual Property and Copyright Statements . . . . . . . 28
1. Introduction
1. Contributors
The major original contributors of this document were: Tatu Ylonen,
Tero Kivinen, Timo J. Rinne, Sami Lehtinen (all of SSH Communications
Security Corp), and Markku-Juhani O. Saarinen (University of
Jyvaskyla)
The document editor is: Darren.Moffat@Sun.COM. Comments on this
internet draft should be sent to the IETF SECSH working group,
details at: http://ietf.org/html.charters/secsh-charter.html
2. Introduction
SSH is a protocol for secure remote login and other secure network SSH is a protocol for secure remote login and other secure network
services over an insecure network. It consists of three major services over an insecure network. It consists of three major
components: components:
o The Transport Layer Protocol [SSH-TRANS] provides server o The Transport Layer Protocol [SSH-TRANS] provides server
authentication, confidentiality, and integrity. It may authentication, confidentiality, and integrity. It may optionally
optionally also provide compression. The transport layer will also provide compression. The transport layer will typically be
typically be run over a TCP/IP connection, but might also be run over a TCP/IP connection, but might also be used on top of any
used on top of any other reliable data stream. other reliable data stream.
o The User Authentication Protocol [SSH-USERAUTH] authenticates o The User Authentication Protocol [SSH-USERAUTH] authenticates the
the client-side user to the server. It runs over the transport client-side user to the server. It runs over the transport layer
layer protocol. protocol.
o The Connection Protocol [SSH-CONNECT] multiplexes the encrypted o The Connection Protocol [SSH-CONNECT] multiplexes the encrypted
tunnel into several logical channels. It runs over the user tunnel into several logical channels. It runs over the user
authentication protocol. authentication protocol.
The client sends a service request once a secure transport layer The client sends a service request once a secure transport layer
connection has been established. A second service request is sent connection has been established. A second service request is sent
after user authentication is complete. This allows new protocols after user authentication is complete. This allows new protocols to
to be defined and coexist with the protocols listed above. be defined and coexist with the protocols listed above.
The connection protocol provides channels that can be used for a The connection protocol provides channels that can be used for a wide
wide range of purposes. Standard methods are provided for setting range of purposes. Standard methods are provided for setting up
up secure interactive shell sessions and for forwarding secure interactive shell sessions and for forwarding ("tunneling")
("tunneling") arbitrary TCP/IP ports and X11 connections. arbitrary TCP/IP ports and X11 connections.
2. Specification of Requirements 3. Specification of Requirements
All documents related to the SSH protocols shall use the keywords All documents related to the SSH protocols shall use the keywords
"MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" to describe "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" to describe
requirements. They are to be interpreted as described in [RFC- requirements. They are to be interpreted as described in [RFC2119].
2119].
3. Architecture 4. Architecture
3.1 Host Keys 4.1 Host Keys
Each server host SHOULD have a host key. Hosts MAY have multiple Each server host SHOULD have a host key. Hosts MAY have multiple
host keys using multiple different algorithms. Multiple hosts MAY host keys using multiple different algorithms. Multiple hosts MAY
share the same host key. If a host has keys at all, it MUST have share the same host key. If a host has keys at all, it MUST have at
at least one key using each REQUIRED public key algorithm least one key using each REQUIRED public key algorithm (DSS
(currently DSS [FIPS-186]). [FIPS-186]).
The server host key is used during key exchange to verify that the The server host key is used during key exchange to verify that the
client is really talking to the correct server. For this to be client is really talking to the correct server. For this to be
possible, the client must have a priori knowledge of the server's possible, the client must have a priori knowledge of the server's
public host key. public host key.
Two different trust models can be used: Two different trust models can be used:
o The client has a local database that associates each host name o The client has a local database that associates each host name (as
(as typed by the user) with the corresponding public host key. typed by the user) with the corresponding public host key. This
This method requires no centrally administered infrastructure, method requires no centrally administered infrastructure, and no
and no third-party coordination. The downside is that the third-party coordination. The downside is that the database of
database of name-to-key associations may become burdensome to name-to-key associations may become burdensome to maintain.
maintain.
o The host name-to-key association is certified by some trusted o The host name-to-key association is certified by some trusted
certification authority. The client only knows the CA root certification authority. The client only knows the CA root key,
key, and can verify the validity of all host keys certified by and can verify the validity of all host keys certified by accepted
accepted CAs. CAs.
The second alternative eases the maintenance problem, since The second alternative eases the maintenance problem, since
ideally only a single CA key needs to be securely stored on the ideally only a single CA key needs to be securely stored on the
client. On the other hand, each host key must be appropriately client. On the other hand, each host key must be appropriately
certified by a central authority before authorization is certified by a central authority before authorization is possible.
possible. Also, a lot of trust is placed on the central Also, a lot of trust is placed on the central infrastructure.
infrastructure.
The protocol provides the option that the server name - host key The protocol provides the option that the server name - host key
association is not checked when connecting to the host for the association is not checked when connecting to the host for the first
first time. This allows communication without prior communication time. This allows communication without prior communication of host
of host keys or certification. The connection still provides keys or certification. The connection still provides protection
protection against passive listening; however, it becomes against passive listening; however, it becomes vulnerable to active
vulnerable to active man-in-the-middle attacks. Implementations man-in-the-middle attacks. Implementations SHOULD NOT normally allow
SHOULD NOT normally allow such connections by default, as they such connections by default, as they pose a potential security
pose a potential security problem. However, as there is no widely problem. However, as there is no widely deployed key infrastructure
deployed key infrastructure available on the Internet yet, this available on the Internet yet, this option makes the protocol much
option makes the protocol much more usable during the transition more usable during the transition time until such an infrastructure
time until such an infrastructure emerges, while still providing a emerges, while still providing a much higher level of security than
much higher level of security than that offered by older solutions that offered by older solutions (e.g. telnet [RFC-854] and rlogin
(e.g. telnet [RFC-854] and rlogin [RFC-1282]). [RFC-1282]).
Implementations SHOULD try to make the best effort to check host Implementations SHOULD try to make the best effort to check host
keys. An example of a possible strategy is to only accept a host keys. An example of a possible strategy is to only accept a host key
key without checking the first time a host is connected, save the without checking the first time a host is connected, save the key in
key in a local database, and compare against that key on all a local database, and compare against that key on all future
future connections to that host. connections to that host.
Implementations MAY provide additional methods for verifying the Implementations MAY provide additional methods for verifying the
correctness of host keys, e.g. a hexadecimal fingerprint derived correctness of host keys, e.g. a hexadecimal fingerprint derived from
from the SHA-1 hash of the public key. Such fingerprints can the SHA-1 hash of the public key. Such fingerprints can easily be
easily be verified by using telephone or other external verified by using telephone or other external communication channels.
communication channels.
All implementations SHOULD provide an option to not accept host All implementations SHOULD provide an option to not accept host keys
keys that cannot be verified. that cannot be verified.
We believe that ease of use is critical to end-user acceptance of We believe that ease of use is critical to end-user acceptance of
security solutions, and no improvement in security is gained if security solutions, and no improvement in security is gained if the
the new solutions are not used. Thus, providing the option not to new solutions are not used. Thus, providing the option not to check
check the server host key is believed to improve the overall the server host key is believed to improve the overall security of
security of the Internet, even though it reduces the security of the Internet, even though it reduces the security of the protocol in
the protocol in configurations where it is allowed. configurations where it is allowed.
3.2 Extensibility 4.2 Extensibility
We believe that the protocol will evolve over time, and some We believe that the protocol will evolve over time, and some
organizations will want to use their own encryption, organizations will want to use their own encryption, authentication
authentication and/or key exchange methods. Central registration and/or key exchange methods. Central registration of all extensions
of all extensions is cumbersome, especially for experimental or is cumbersome, especially for experimental or classified features.
classified features. On the other hand, having no central On the other hand, having no central registration leads to conflicts
registration leads to conflicts in method identifiers, making in method identifiers, making interoperability difficult.
interoperability difficult.
We have chosen to identify algorithms, methods, formats, and We have chosen to identify algorithms, methods, formats, and
extension protocols with textual names that are of a specific extension protocols with textual names that are of a specific format.
format. DNS names are used to create local namespaces where DNS names are used to create local namespaces where experimental or
experimental or classified extensions can be defined without fear classified extensions can be defined without fear of conflicts with
of conflicts with other implementations. other implementations.
One design goal has been to keep the base protocol as simple as One design goal has been to keep the base protocol as simple as
possible, and to require as few algorithms as possible. However, possible, and to require as few algorithms as possible. However, all
all implementations MUST support a minimal set of algorithms to implementations MUST support a minimal set of algorithms to ensure
ensure interoperability (this does not imply that the local policy interoperability (this does not imply that the local policy on all
on all hosts would necessary allow these algorithms). The hosts would necessary allow these algorithms). The mandatory
mandatory algorithms are specified in the relevant protocol algorithms are specified in the relevant protocol documents.
documents.
Additional algorithms, methods, formats, and extension protocols Additional algorithms, methods, formats, and extension protocols can
can be defined in separate drafts. See Section Algorithm Naming be defined in separate drafts. See Section Algorithm Naming (Section
(Section 5) for more information. 6) for more information.
3.3 Policy Issues 4.3 Policy Issues
The protocol allows full negotiation of encryption, integrity, key The protocol allows full negotiation of encryption, integrity, key
exchange, compression, and public key algorithms and formats. exchange, compression, and public key algorithms and formats.
Encryption, integrity, public key, and compression algorithms can Encryption, integrity, public key, and compression algorithms can be
be different for each direction. different for each direction.
The following policy issues SHOULD be addressed in the The following policy issues SHOULD be addressed in the configuration
configuration mechanisms of each implementation: mechanisms of each implementation:
o Encryption, integrity, and compression algorithms, separately o Encryption, integrity, and compression algorithms, separately for
for each direction. The policy MUST specify which is the each direction. The policy MUST specify which is the preferred
preferred algorithm (e.g. the first algorithm listed in each algorithm (e.g. the first algorithm listed in each category).
category). o Public key algorithms and key exchange method to be used for host
o Public key algorithms and key exchange method to be used for authentication. The existence of trusted host keys for different
host authentication. The existence of trusted host keys for public key algorithms also affects this choice.
different public key algorithms also affects this choice. o The authentication methods that are to be required by the server
o The authentication methods that are to be required by the for each user. The server's policy MAY require multiple
server for each user. The server's policy MAY require multiple authentication for some or all users. The required algorithms MAY
authentication for some or all users. The required algorithms depend on the location where the user is trying to log in from.
MAY depend on the location where the user is trying to log in
from.
o The operations that the user is allowed to perform using the o The operations that the user is allowed to perform using the
connection protocol. Some issues are related to security; for connection protocol. Some issues are related to security; for
example, the policy SHOULD NOT allow the server to start example, the policy SHOULD NOT allow the server to start sessions
sessions or run commands on the client machine, and MUST NOT or run commands on the client machine, and MUST NOT allow
allow connections to the authentication agent unless forwarding connections to the authentication agent unless forwarding such
such connections has been requested. Other issues, such as connections has been requested. Other issues, such as which TCP/
which TCP/IP ports can be forwarded and by whom, are clearly IP ports can be forwarded and by whom, are clearly issues of local
issues of local policy. Many of these issues may involve policy. Many of these issues may involve traversing or bypassing
traversing or bypassing firewalls, and are interrelated with firewalls, and are interrelated with the local security policy.
the local security policy.
3.4 Security Properties 4.4 Security Properties
The primary goal of the SSH protocol is improved security on the The primary goal of the SSH protocol is improved security on the
Internet. It attempts to do this in a way that is easy to deploy, Internet. It attempts to do this in a way that is easy to deploy,
even at the cost of absolute security. even at the cost of absolute security.
o All encryption, integrity, and public key algorithms used are o All encryption, integrity, and public key algorithms used are
well-known, well-established algorithms. well-known, well-established algorithms.
o All algorithms are used with cryptographically sound key sizes o All algorithms are used with cryptographically sound key sizes
that are believed to provide protection against even the that are believed to provide protection against even the strongest
strongest cryptanalytic attacks for decades. cryptanalytic attacks for decades.
o All algorithms are negotiated, and in case some algorithm is o All algorithms are negotiated, and in case some algorithm is
broken, it is easy to switch to some other algorithm without broken, it is easy to switch to some other algorithm without
modifying the base protocol. modifying the base protocol.
Specific concessions were made to make wide-spread fast deployment Specific concessions were made to make wide-spread fast deployment
easier. The particular case where this comes up is verifying that easier. The particular case where this comes up is verifying that
the server host key really belongs to the desired host; the the server host key really belongs to the desired host; the protocol
protocol allows the verification to be left out (but this is NOT allows the verification to be left out (but this is NOT RECOMMENDED).
RECOMMENDED). This is believed to significantly improve usability This is believed to significantly improve usability in the short
in the short term, until widespread Internet public key term, until widespread Internet public key infrastructures emerge.
infrastructures emerge.
3.5 Packet Size and Overhead 4.5 Packet Size and Overhead
Some readers will worry about the increase in packet size due to Some readers will worry about the increase in packet size due to new
new headers, padding, and MAC. The minimum packet size is in the headers, padding, and MAC. The minimum packet size is in the order
order of 28 bytes (depending on negotiated algorithms). The of 28 bytes (depending on negotiated algorithms). The increase is
increase is negligible for large packets, but very significant for negligible for large packets, but very significant for one-byte
one-byte packets (telnet-type sessions). There are, however, packets (telnet-type sessions). There are, however, several factors
several factors that make this a non-issue in almost all cases: that make this a non-issue in almost all cases:
o The minimum size of a TCP/IP header is 32 bytes. Thus, the o The minimum size of a TCP/IP header is 32 bytes. Thus, the
increase is actually from 33 to 51 bytes (roughly). increase is actually from 33 to 51 bytes (roughly).
o The minimum size of the data field of an Ethernet packet is 46 o The minimum size of the data field of an Ethernet packet is 46
bytes [RFC-894]. Thus, the increase is no more than 5 bytes. bytes [RFC-894]. Thus, the increase is no more than 5 bytes. When
When Ethernet headers are considered, the increase is less than Ethernet headers are considered, the increase is less than 10
10 percent. percent.
o The total fraction of telnet-type data in the Internet is o The total fraction of telnet-type data in the Internet is
negligible, even with increased packet sizes. negligible, even with increased packet sizes.
The only environment where the packet size increase is likely to The only environment where the packet size increase is likely to have
have a significant effect is PPP [RFC-1134] over slow modem lines a significant effect is PPP [RFC-1134] over slow modem lines (PPP
(PPP compresses the TCP/IP headers, emphasizing the increase in compresses the TCP/IP headers, emphasizing the increase in packet
packet size). However, with modern modems, the time needed to size). However, with modern modems, the time needed to transfer is in
transfer is in the order of 2 milliseconds, which is a lot faster the order of 2 milliseconds, which is a lot faster than people can
than people can type. type.
There are also issues related to the maximum packet size. To There are also issues related to the maximum packet size. To
minimize delays in screen updates, one does not want excessively minimize delays in screen updates, one does not want excessively
large packets for interactive sessions. The maximum packet size large packets for interactive sessions. The maximum packet size is
is negotiated separately for each channel. negotiated separately for each channel.
3.6 Localization and Character Set Support 4.6 Localization and Character Set Support
For the most part, the SSH protocols do not directly pass text For the most part, the SSH protocols do not directly pass text that
that would be displayed to the user. However, there are some would be displayed to the user. However, there are some places where
places where such data might be passed. When applicable, the such data might be passed. When applicable, the character set for the
character set for the data MUST be explicitly specified. In most data MUST be explicitly specified. In most places, ISO 10646 with
places, ISO 10646 with UTF-8 encoding is used [RFC-2279]. When UTF-8 encoding is used [RFC-2279]. When applicable, a field is also
applicable, a field is also provided for a language tag [RFC- provided for a language tag [RFC-3066].
1766].
One big issue is the character set of the interactive session. One big issue is the character set of the interactive session. There
There is no clear solution, as different applications may display is no clear solution, as different applications may display data in
data in different formats. Different types of terminal emulation different formats. Different types of terminal emulation may also be
may also be employed in the client, and the character set to be employed in the client, and the character set to be used is
used is effectively determined by the terminal emulation. Thus, effectively determined by the terminal emulation. Thus, no place is
no place is provided for directly specifying the character set or provided for directly specifying the character set or encoding for
encoding for terminal session data. However, the terminal terminal session data. However, the terminal emulation type (e.g.
emulation type (e.g. "vt100") is transmitted to the remote site, "vt100") is transmitted to the remote site, and it implicitly
and it implicitly specifies the character set and encoding. specifies the character set and encoding. Applications typically use
Applications typically use the terminal type to determine what the terminal type to determine what character set they use, or the
character set they use, or the character set is determined using character set is determined using some external means. The terminal
some external means. The terminal emulation may also allow emulation may also allow configuring the default character set. In
configuring the default character set. In any case, the character any case, the character set for the terminal session is considered
set for the terminal session is considered primarily a client primarily a client local issue.
local issue.
Internal names used to identify algorithms or protocols are Internal names used to identify algorithms or protocols are normally
normally never displayed to users, and must be in US-ASCII. never displayed to users, and must be in US-ASCII.
The client and server user names are inherently constrained by The client and server user names are inherently constrained by what
what the server is prepared to accept. They might, however, the server is prepared to accept. They might, however, occasionally
occasionally be displayed in logs, reports, etc. They MUST be be displayed in logs, reports, etc. They MUST be encoded using ISO
encoded using ISO 10646 UTF-8, but other encodings may be required 10646 UTF-8, but other encodings may be required in some cases. It
in some cases. It is up to the server to decide how to map user is up to the server to decide how to map user names to accepted user
names to accepted user names. Straight bit-wise binary comparison names. Straight bit-wise binary comparison is RECOMMENDED.
is RECOMMENDED.
For localization purposes, the protocol attempts to minimize the For localization purposes, the protocol attempts to minimize the
number of textual messages transmitted. When present, such number of textual messages transmitted. When present, such messages
messages typically relate to errors, debugging information, or typically relate to errors, debugging information, or some externally
some externally configured data. For data that is normally configured data. For data that is normally displayed, it SHOULD be
displayed, it SHOULD be possible to fetch a localized message possible to fetch a localized message instead of the transmitted
instead of the transmitted message by using a numerical code. The message by using a numerical code. The remaining messages SHOULD be
remaining messages SHOULD be configurable. configurable.
4. Data Type Representations Used in the SSH Protocols 5. Data Type Representations Used in the SSH Protocols
byte byte
A byte represents an arbitrary 8-bit value (octet) [RFC-1700]. A byte represents an arbitrary 8-bit value (octet) [RFC-1700].
Fixed length data is sometimes represented as an array of Fixed length data is sometimes represented as an array of bytes,
bytes, written byte[n], where n is the number of bytes in the written byte[n], where n is the number of bytes in the array.
array.
boolean boolean
A boolean value is stored as a single byte. The value 0 A boolean value is stored as a single byte. The value 0
represents FALSE, and the value 1 represents TRUE. All non- represents FALSE, and the value 1 represents TRUE. All non-zero
zero values MUST be interpreted as TRUE; however, applications values MUST be interpreted as TRUE; however, applications MUST NOT
MUST NOT store values other than 0 and 1. store values other than 0 and 1.
uint32 uint32
Represents a 32-bit unsigned integer. Stored as four bytes in Represents a 32-bit unsigned integer. Stored as four bytes in the
the order of decreasing significance (network byte order). For order of decreasing significance (network byte order). For
example, the value 699921578 (0x29b7f4aa) is stored as 29 b7 f4 example, the value 699921578 (0x29b7f4aa) is stored as 29 b7 f4
aa. aa.
uint64 uint64
Represents a 64-bit unsigned integer. Stored as eight bytes in Represents a 64-bit unsigned integer. Stored as eight bytes in
the order of decreasing significance (network byte order). the order of decreasing significance (network byte order).
string string
Arbitrary length binary string. Strings are allowed to contain Arbitrary length binary string. Strings are allowed to contain
arbitrary binary data, including null characters and 8-bit arbitrary binary data, including null characters and 8-bit
characters. They are stored as a uint32 containing its length characters. They are stored as a uint32 containing its length
(number of bytes that follow) and zero (= empty string) or more (number of bytes that follow) and zero (= empty string) or more
bytes that are the value of the string. Terminating null bytes that are the value of the string. Terminating null
characters are not used. characters are not used.
Strings are also used to store text. In that case, US-ASCII is Strings are also used to store text. In that case, US-ASCII is
used for internal names, and ISO-10646 UTF-8 for text that used for internal names, and ISO-10646 UTF-8 for text that might
might be displayed to the user. The terminating null character be displayed to the user. The terminating null character SHOULD
SHOULD NOT normally be stored in the string. NOT normally be stored in the string.
For example, the US-ASCII string "testing" is represented as 00 For example, the US-ASCII string "testing" is represented as 00 00
00 00 07 t e s t i n g. The UTF8 mapping does not alter the 00 07 t e s t i n g. The UTF8 mapping does not alter the encoding
encoding of US-ASCII characters. of US-ASCII characters.
mpint mpint
Represents multiple precision integers in two's complement Represents multiple precision integers in two's complement format,
format, stored as a string, 8 bits per byte, MSB first. stored as a string, 8 bits per byte, MSB first. Negative numbers
Negative numbers have the value 1 as the most significant bit have the value 1 as the most significant bit of the first byte of
of the first byte of the data partition. If the most the data partition. If the most significant bit would be set for a
significant bit would be set for a positive number, the number positive number, the number MUST be preceded by a zero byte.
MUST be preceded by a zero byte. Unnecessary leading bytes Unnecessary leading bytes with the value 0 or 255 MUST NOT be
with the value 0 or 255 MUST NOT be included. The value zero included. The value zero MUST be stored as a string with zero
MUST be stored as a string with zero bytes of data. bytes of data.
By convention, a number that is used in modular computations in By convention, a number that is used in modular computations in
Z_n SHOULD be represented in the range 0 <= x < n. Z_n SHOULD be represented in the range 0 <= x < n.
Examples: Examples:
value (hex) representation (hex) value (hex) representation (hex)
--------------------------------------------------------------- ---------------------------------------------------------------
0 00 00 00 00 0 00 00 00 00
9a378f9b2e332a7 00 00 00 08 09 a3 78 f9 b2 e3 32 a7 9a378f9b2e332a7 00 00 00 08 09 a3 78 f9 b2 e3 32 a7
80 00 00 00 02 00 80 80 00 00 00 02 00 80
-1234 00 00 00 02 ed cc -1234 00 00 00 02 ed cc
-deadbeef 00 00 00 05 ff 21 52 41 11 -deadbeef 00 00 00 05 ff 21 52 41 11
name-list name-list
A string containing a comma separated list of names. A name A string containing a comma separated list of names. A name list
list is represented as a uint32 containing its length (number is represented as a uint32 containing its length (number of bytes
of bytes that follow) followed by a comma-separated list of that follow) followed by a comma-separated list of zero or more
zero or more names. A name MUST be non-zero length, and it names. A name MUST be non-zero length, and it MUST NOT contain a
MUST NOT contain a comma (','). Context may impose additional comma (','). Context may impose additional restrictions on the
restrictions on the names; for example, the names in a list may names; for example, the names in a list may have to be valid
have to be valid algorithm identifier (see Algorithm Naming algorithm identifier (see Algorithm Naming below), or [RFC-3066]
below), or [RFC-1766] language tags. The order of the names in language tags. The order of the names in a list may or may not be
a list may or may not be significant, also depending on the significant, also depending on the context where the list is is
context where the list is is used. Terminating NUL characters used. Terminating NUL characters are not used, neither for the
are not used, neither for the individual names, nor for the individual names, nor for the list as a whole.
list as a whole.
Examples: Examples:
value representation (hex) value representation (hex)
--------------------------------------- ---------------------------------------
(), the empty list 00 00 00 00 (), the empty list 00 00 00 00
("zlib") 00 00 00 04 7a 6c 69 62 ("zlib") 00 00 00 04 7a 6c 69 62
("zlib", "none") 00 00 00 09 7a 6c 69 62 2c 6e 6f 6e 65 ("zlib", "none") 00 00 00 09 7a 6c 69 62 2c 6e 6f 6e 65
5. Algorithm Naming 6. Algorithm Naming
The SSH protocols refer to particular hash, encryption, integrity, The SSH protocols refer to particular hash, encryption, integrity,
compression, and key exchange algorithms or protocols by names. compression, and key exchange algorithms or protocols by names.
There are some standard algorithms that all implementations MUST There are some standard algorithms that all implementations MUST
support. There are also algorithms that are defined in the support. There are also algorithms that are defined in the protocol
protocol specification but are OPTIONAL. Furthermore, it is specification but are OPTIONAL. Furthermore, it is expected that
expected that some organizations will want to use their own some organizations will want to use their own algorithms.
algorithms.
In this protocol, all algorithm identifiers MUST be printable US- In this protocol, all algorithm identifiers MUST be printable
ASCII non-empty strings no longer than 64 characters. Names MUST US-ASCII non-empty strings no longer than 64 characters. Names MUST
be case-sensitive. be case-sensitive.
There are two formats for algorithm names: There are two formats for algorithm names:
o Names that do not contain an at-sign (@) are reserved to be o Names that do not contain an at-sign (@) are reserved to be
assigned by IETF consensus (RFCs). Examples include `3des- assigned by IETF consensus (RFCs). Examples include `3des-cbc',
cbc', `sha-1', `hmac-sha1', and `zlib' (the quotes are not part `sha-1', `hmac-sha1', and `zlib' (the quotes are not part of the
of the name). Names of this format MUST NOT be used without name). Names of this format MUST NOT be used without first
first registering them. Registered names MUST NOT contain an registering them. Registered names MUST NOT contain an at-sign
at-sign (@) or a comma (,). (@) or a comma (,).
o Anyone can define additional algorithms by using names in the o Anyone can define additional algorithms by using names in the
format name@domainname, e.g. "ourcipher-cbc@ssh.com". The format name@domainname, e.g. "ourcipher-cbc@example.com". The
format of the part preceding the at sign is not specified; it format of the part preceding the at sign is not specified; it MUST
MUST consist of US-ASCII characters except at-sign and comma. consist of US-ASCII characters except at-sign and comma. The part
The part following the at-sign MUST be a valid fully qualified following the at-sign MUST be a valid fully qualified internet
internet domain name [RFC-1034] controlled by the person or domain name [RFC-1034] controlled by the person or organization
organization defining the name. It is up to each domain how it defining the name. It is up to each domain how it manages its
manages its local namespace. local namespace.
6. Message Numbers 7. Message Numbers
SSH packets have message numbers in the range 1 to 255. These SSH packets have message numbers in the range 1 to 255. These numbers
numbers have been allocated as follows: have been allocated as follows:
Transport layer protocol: Transport layer protocol:
1 to 19 Transport layer generic (e.g. disconnect, ignore, debug, 1 to 19 Transport layer generic (e.g. disconnect, ignore, debug,
etc.) etc.)
20 to 29 Algorithm negotiation 20 to 29 Algorithm negotiation
30 to 49 Key exchange method specific (numbers can be reused for 30 to 49 Key exchange method specific (numbers can be reused for
different authentication methods) different authentication methods)
User authentication protocol: User authentication protocol:
skipping to change at page 12, line 38 skipping to change at page 11, line 37
90 to 127 Channel related messages 90 to 127 Channel related messages
Reserved for client protocols: Reserved for client protocols:
128 to 191 Reserved 128 to 191 Reserved
Local extensions: Local extensions:
192 to 255 Local extensions 192 to 255 Local extensions
7. IANA Considerations 8. IANA Considerations
The initial state of the IANA registry is detailed in [SSH-NUMBERS].
Allocation of the following types of names in the SSH protocols is Allocation of the following types of names in the SSH protocols is
assigned by IETF consensus: assigned by IETF consensus:
o encryption algorithm names, o SSH encryption algorithm names,
o MAC algorithm names, o SSH MAC algorithm names,
o public key algorithm names (public key algorithm also implies o SSH public key algorithm names (public key algorithm also implies
encoding and signature/encryption capability), encoding and signature/encryption capability),
o key exchange method names, and o SSH key exchange method names, and
o protocol (service) names. o SSH protocol (service) names.
These names MUST be printable US-ASCII strings, and MUST NOT These names MUST be printable US-ASCII strings, and MUST NOT contain
contain the characters at-sign ('@'), comma (','), or whitespace the characters at-sign ('@'), comma (','), or whitespace or control
or control characters (ASCII codes 32 or less). Names are case- characters (ASCII codes 32 or less). Names are case-sensitive, and
sensitive, and MUST NOT be longer than 64 characters. MUST NOT be longer than 64 characters.
Names with the at-sign ('@') in them are allocated by the owner of Names with the at-sign ('@') in them are allocated by the owner of
DNS name after the at-sign (hierarchical allocation in [RFC- DNS name after the at-sign (hierarchical allocation in [RFC-2343]),
2343]), otherwise the same restrictions as above. otherwise the same restrictions as above.
Each category of names listed above has a separate namespace. Each category of names listed above has a separate namespace.
However, using the same name in multiple categories SHOULD be However, using the same name in multiple categories SHOULD be avoided
avoided to minimize confusion. to minimize confusion.
Message numbers (see Section Message Numbers (Section 6)) in the Message numbers (see Section Message Numbers (Section 7)) in the
range of 0..191 should be allocated via IETF consensus; message range of 0..191 are allocated via IETF consensus; message numbers in
numbers in the 192..255 range (the "Local extensions" set) are the 192..255 range (the "Local extensions" set) are reserved for
reserved for private use. private use.
8. Security Considerations 9. Security Considerations
In order to make the entire body of Security Considerations more In order to make the entire body of Security Considerations more
accessible, Security Considerations for the transport, accessible, Security Considerations for the transport,
authentication, and connection documents have been gathered here. authentication, and connection documents have been gathered here.
The transport protocol [1] provides a confidential channel over an The transport protocol [1] provides a confidential channel over an
insecure network. It performs server host authentication, key insecure network. It performs server host authentication, key
exchange, encryption, and integrity protection. It also derives a exchange, encryption, and integrity protection. It also derives a
unique session id that may be used by higher-level protocols. unique session id that may be used by higher-level protocols.
The authentication protocol [2] provides a suite of mechanisms The authentication protocol [2] provides a suite of mechanisms which
which can be used to authenticate the client user to the server. can be used to authenticate the client user to the server.
Individual mechanisms specified in the in authentication protocol Individual mechanisms specified in the in authentication protocol use
use the session id provided by the transport protocol and/or the session id provided by the transport protocol and/or depend on
depend on the security and integrity guarantees of the transport the security and integrity guarantees of the transport protocol.
protocol.
The connection protocol [3] specifies a mechanism to multiplex The connection protocol [3] specifies a mechanism to multiplex
multiple streams [channels] of data over the confidential and multiple streams [channels] of data over the confidential and
authenticated transport. It also specifies channels for accessing authenticated transport. It also specifies channels for accessing an
an interactive shell, for 'proxy-forwarding' various external interactive shell, for 'proxy-forwarding' various external protocols
protocols over the secure transport (including arbitrary TCP/IP over the secure transport (including arbitrary TCP/IP protocols), and
protocols), and for accessing secure 'subsystems' on the server for accessing secure 'subsystems' on the server host.
host.
8.1 Pseudo-Random Number Generation 9.1 Pseudo-Random Number Generation
This protocol binds each session key to the session by including This protocol binds each session key to the session by including
random, session specific data in the hash used to produce session random, session specific data in the hash used to produce session
keys. Special care should be taken to ensure that all of the keys. Special care should be taken to ensure that all of the random
random numbers are of good quality. If the random data here numbers are of good quality. If the random data here (e.g., DH
(e.g., DH parameters) are pseudo-random then the pseudo-random parameters) are pseudo-random then the pseudo-random number generator
number generator should be cryptographically secure (i.e., its should be cryptographically secure (i.e., its next output not easily
next output not easily guessed even when knowing all previous guessed even when knowing all previous outputs) and, furthermore,
outputs) and, furthermore, proper entropy needs to be added to the proper entropy needs to be added to the pseudo-random number
pseudo-random number generator. RFC 1750 [1750] offers generator. RFC 1750 [1750] offers suggestions for sources of random
suggestions for sources of random numbers and entropy. numbers and entropy. Implementors should note the importance of
Implementors should note the importance of entropy and the well- entropy and the well-meant, anecdotal warning about the difficulty in
meant, anecdotal warning about the difficulty in properly properly implementing pseudo-random number generating functions.
implementing pseudo-random number generating functions.
The amount of entropy available to a given client or server may The amount of entropy available to a given client or server may
sometimes be less than what is required. In this case one must sometimes be less than what is required. In this case one must
either resort to pseudo-random number generation regardless of either resort to pseudo-random number generation regardless of
insufficient entropy or refuse to run the protocol. The latter is insufficient entropy or refuse to run the protocol. The latter is
preferable. preferable.
8.2 Transport 9.2 Transport
8.2.1 Confidentiality 9.2.1 Confidentiality
It is beyond the scope of this document and the Secure Shell It is beyond the scope of this document and the Secure Shell Working
Working Group to analyze or recommend specific ciphers other than Group to analyze or recommend specific ciphers other than the ones
the ones which have been established and accepted within the which have been established and accepted within the industry. At the
industry. At the time of this writing, ciphers commonly in use time of this writing, ciphers commonly in use include 3DES, ARCFOUR,
include 3DES, ARCFOUR, twofish, serpent and blowfish. AES has twofish, serpent and blowfish. AES has been accepted by The
been accepted by The published as a US Federal Information published as a US Federal Information Processing Standards [FIPS-197]
Processing Standards [FIPS-197] and the cryptographic community as and the cryptographic community as being acceptable for this purpose
being acceptable for this purpose as well has accepted AES. As as well has accepted AES. As always, implementors and users should
always, implementors and users should check current literature to check current literature to ensure that no recent vulnerabilities
ensure that no recent vulnerabilities have been found in ciphers have been found in ciphers used within products. Implementors should
used within products. Implementors should also check to see which also check to see which ciphers are considered to be relatively
ciphers are considered to be relatively stronger than others and stronger than others and should recommend their use to users over
should recommend their use to users over relatively weaker relatively weaker ciphers. It would be considered good form for an
ciphers. It would be considered good form for an implementation implementation to politely and unobtrusively notify a user that a
to politely and unobtrusively notify a user that a stronger cipher stronger cipher is available and should be used when a weaker one is
is available and should be used when a weaker one is actively actively chosen.
chosen.
The "none" cipher is provided for debugging and SHOULD NOT be used The "none" cipher is provided for debugging and SHOULD NOT be used
except for that purpose. It's cryptographic properties are except for that purpose. It's cryptographic properties are
sufficiently described in RFC 2410, which will show that its use sufficiently described in RFC 2410, which will show that its use does
does not meet the intent of this protocol. not meet the intent of this protocol.
The relative merits of these and other ciphers may also be found The relative merits of these and other ciphers may also be found in
in current literature. Two references that may provide current literature. Two references that may provide information on
information on the subject are [SCHNEIER] and the subject are [SCHNEIER] and [KAUFMAN,PERLMAN,SPECINER]. Both of
[KAUFMAN,PERLMAN,SPECINER]. Both of these describe the CBC mode these describe the CBC mode of operation of certain ciphers and the
of operation of certain ciphers and the weakness of this scheme. weakness of this scheme. Essentially, this mode is theoretically
Essentially, this mode is theoretically vulnerable to chosen vulnerable to chosen cipher-text attacks because of the high
cipher-text attacks because of the high predictability of the predictability of the start of packet sequence. However, this attack
start of packet sequence. However, this attack is still deemed is still deemed difficult and not considered fully practicable
difficult and not considered fully practicable especially if especially if relatively longer block sizes are used.
relatively longer block sizes are used.
Additionally, another CBC mode attack may be mitigated through the Additionally, another CBC mode attack may be mitigated through the
insertion of packets containing SSH_MSG_IGNORE. Without this insertion of packets containing SSH_MSG_IGNORE. Without this
technique, a specific attack may be successful. For this attack technique, a specific attack may be successful. For this attack
(commonly known as the Rogaway attack (commonly known as the Rogaway attack
[ROGAWAY],[DAI],[BELLARE,KOHNO,NAMPREMPRE]) to work, the attacker [ROGAWAY],[DAI],[BELLARE,KOHNO,NAMPREMPRE]) to work, the attacker
would need to know the IV of the next block that is going to be would need to know the IV of the next block that is going to be
encrypted. In CBC mode that is the output of the encryption of encrypted. In CBC mode that is the output of the encryption of the
the previous block. If the attacker does not have any way to see previous block. If the attacker does not have any way to see the
the packet yet (i.e it is in the internal buffers of the ssh packet yet (i.e it is in the internal buffers of the ssh
implementation or even in the kernel) then this attack will not implementation or even in the kernel) then this attack will not work.
work. If the last packet has been sent out to the network (i.e If the last packet has been sent out to the network (i.e the attacker
the attacker has access to it) then he can use the attack. has access to it) then he can use the attack.
In the optimal case an implementor would need to add an extra In the optimal case an implementor would need to add an extra packet
packet only if the packet has been sent out onto the network and only if the packet has been sent out onto the network and there are
there are no other packets waiting for transmission. Implementors no other packets waiting for transmission. Implementors may wish to
may wish to check to see if there are any unsent packets awaiting check to see if there are any unsent packets awaiting transmission,
transmission, but unfortunately it is not normally easy to obtain but unfortunately it is not normally easy to obtain this information
this information from the kernel or buffers. If there are not, from the kernel or buffers. If there are not, then a packet
then a packet containing SSH_MSG_IGNORE SHOULD be sent. If a new containing SSH_MSG_IGNORE SHOULD be sent. If a new packet is added
packet is added to the stream every time the attacker knows the IV to the stream every time the attacker knows the IV that is supposed
that is supposed to be used for the next packet, then the attacker to be used for the next packet, then the attacker will not be able to
will not be able to guess the correct IV, thus the attack will guess the correct IV, thus the attack will never be successfull.
never be successfull.
As an example, consider the following case: As an example, consider the following case:
Client Server Client Server
------ ------ ------ ------
TCP(seq=x, len=500) -> TCP(seq=x, len=500) ->
contains Record 1 contains Record 1
[500 ms passes, no ACK] [500 ms passes, no ACK]
TCP(seq=x, len=1000) -> TCP(seq=x, len=1000) ->
contains Records 1,2 contains Records 1,2
ACK ACK
1. The Nagle algorithm + TCP retransmits mean that the two
records get coalesced into a single TCP segment 1. The Nagle algorithm + TCP retransmits mean that the two records
2. Record 2 is *not* at the beginning of the TCP segment and get coalesced into a single TCP segment
never will be, since it gets ACKed. 2. Record 2 is *not* at the beginning of the TCP segment and never
will be, since it gets ACKed.
3. Yet, the attack is possible because Record 1 has already been 3. Yet, the attack is possible because Record 1 has already been
seen. seen.
As this example indicates, it's totally unsafe to use the As this example indicates, it's totally unsafe to use the existence
existence of unflushed data in the TCP buffers proper as a guide of unflushed data in the TCP buffers proper as a guide to whether you
to whether you need an empty packet, since when you do the second need an empty packet, since when you do the second write(), the
write(), the buffers will contain the un-ACKed Record 1. buffers will contain the un-ACKed Record 1.
On the other hand, it's perfectly safe to have the following On the other hand, it's perfectly safe to have the following
situation: situation:
Client Server Client Server
------ ------ ------ ------
TCP(seq=x, len=500) -> TCP(seq=x, len=500) ->
contains SSH_MSG_IGNORE contains SSH_MSG_IGNORE
TCP(seq=y, len=500) -> TCP(seq=y, len=500) ->
contains Data contains Data
Provided that the IV for second SSH Record is fixed after the data for Provided that the IV for second SSH Record is fixed after the data for
the Data packet is determined -i.e. you do: the Data packet is determined -i.e. you do:
read from user read from user
encrypt null packet encrypt null packet
encrypt data packet encrypt data packet
8.2.2 Data Integrity 9.2.2 Data Integrity
This protocol does allow the Data Integrity mechanism to be This protocol does allow the Data Integrity mechanism to be disabled.
disabled. Implementors SHOULD be wary of exposing this feature Implementors SHOULD be wary of exposing this feature for any purpose
for any purpose other than debugging. Users and administrators other than debugging. Users and administrators SHOULD be explicitly
SHOULD be explicitly warned anytime the "none" MAC is enabled. warned anytime the "none" MAC is enabled.
So long as the "none" MAC is not used, this protocol provides data So long as the "none" MAC is not used, this protocol provides data
integrity. integrity.
Because MACs use a 32 bit sequence number, they might start to Because MACs use a 32 bit sequence number, they might start to leak
leak information after 2**32 packets have been sent. However, information after 2**32 packets have been sent. However, following
following the rekeying recommendations should prevent this attack. the rekeying recommendations should prevent this attack. The
The transport protocol [1] recommends rekeying after one gigabyte transport protocol [1] recommends rekeying after one gigabyte of
of data, and the smallest possible packet is 16 bytes. Therefore, data, and the smallest possible packet is 16 bytes. Therefore,
rekeying SHOULD happen after 2**28 packets at the very most. rekeying SHOULD happen after 2**28 packets at the very most.
8.2.3 Replay 9.2.3 Replay
The use of a MAC other than 'none' provides integrity and The use of a MAC other than 'none' provides integrity and
authentication. In addition, the transport protocol provides a authentication. In addition, the transport protocol provides a
unique session identifier (bound in part to pseudo-random data unique session identifier (bound in part to pseudo-random data that
that is part of the algorithm and key exchange process) that can is part of the algorithm and key exchange process) that can be used
be used by higher level protocols to bind data to a given session by higher level protocols to bind data to a given session and prevent
and prevent replay of data from prior sessions. For example, the replay of data from prior sessions. For example, the authentication
authentication protocol uses this to prevent replay of signatures protocol uses this to prevent replay of signatures from previous
from previous sessions. Because public key authentication sessions. Because public key authentication exchanges are
exchanges are cryptographically bound to the session (i.e., to the cryptographically bound to the session (i.e., to the initial key
initial key exchange) they cannot be successfully replayed in exchange) they cannot be successfully replayed in other sessions.
other sessions. Note that the session ID can be made public
without harming the security of the protocol. Note that the session ID can be made public without harming the
security of the protocol.
If two session happen to have the same session ID [hash of key If two session happen to have the same session ID [hash of key
exchanges] then packets from one can be replayed against the exchanges] then packets from one can be replayed against the other.
other. It must be stressed that the chances of such an occurrence It must be stressed that the chances of such an occurrence are,
are, needless to say, minimal when using modern cryptographic needless to say, minimal when using modern cryptographic methods.
methods. This is all the more so true when specifying larger hash This is all the more so true when specifying larger hash function
function outputs and DH parameters. outputs and DH parameters.
Replay detection using monotonically increasing sequence numbers Replay detection using monotonically increasing sequence numbers as
as input to the MAC, or HMAC in some cases, is described in RFC input to the MAC, or HMAC in some cases, is described in [RFC2085] />
2085 [2085], RFC 2246 [2246], RFC 2743 [2743], RFC 1964 [1964], [RFC2246], [RFC2743], [RFC1964], [RFC2025], and [RFC1510]. The
RFC 2025 [2025], and RFC 1510 [1510]. The underlying construct is underlying construct is discussed in [RFC2104]. Essentially a
discussed in RFC 2104 [2104]. Essentially a different sequence different sequence number in each packet ensures that at least this
number in each packet ensures that at least this one input to the one input to the MAC function will be unique and will provide a
MAC function will be unique and will provide a nonrecurring MAC nonrecurring MAC output that is not predictable to an attacker. If
output that is not predictable to an attacker. If the session the session stays active long enough, however, this sequence number
stays active long enough, however, this sequence number will wrap. will wrap. This event may provide an attacker an opportunity to
This event may provide an attacker an opportunity to replay a replay a previously recorded packet with an identical sequence number
previously recorded packet with an identical sequence number but but only if the peers have not rekeyed since the transmission of the
only if the peers have not rekeyed since the transmission of the first packet with that sequence number. If the peers have rekeyed,
first packet with that sequence number. If the peers have then the replay will be detected as the MAC check will fail. For
rekeyed, then the replay will be detected as the MAC check will this reason, it must be emphasized that peers MUST rekey before a
fail. For this reason, it must be emphasized that peers MUST wrap of the sequence numbers. Naturally, if an attacker does attempt
rekey before a wrap of the sequence numbers. Naturally, if an to replay a captured packet before the peers have rekeyed, then the
attacker does attempt to replay a captured packet before the peers receiver of the duplicate packet will not be able to validate the MAC
have rekeyed, then the receiver of the duplicate packet will not and it will be discarded. The reason that the MAC will fail is
be able to validate the MAC and it will be discarded. The reason because the receiver will formulate a MAC based upon the packet
that the MAC will fail is because the receiver will formulate a contents, the shared secret, and the expected sequence number. Since
MAC based upon the packet contents, the shared secret, and the the replayed packet will not be using that expected sequence number
expected sequence number. Since the replayed packet will not be (the sequence number of the replayed packet will have already been
using that expected sequence number (the sequence number of the passed by the receiver) then the calculated MAC will not match the
replayed packet will have already been passed by the receiver) MAC received with the packet.
then the calculated MAC will not match the MAC received with the
packet.
8.2.4 Man-in-the-middle 9.2.4 Man-in-the-middle
This protocol makes no assumptions nor provisions for an This protocol makes no assumptions nor provisions for an
infrastructure or means for distributing the public keys of hosts. infrastructure or means for distributing the public keys of hosts. It
It is expected that this protocol will sometimes be used without is expected that this protocol will sometimes be used without first
first verifying the association between the server host key and verifying the association between the server host key and the server
the server host name. Such usage is vulnerable to man-in-the- host name. Such usage is vulnerable to man-in-the-middle attacks.
middle attacks. This section describes this and encourages This section describes this and encourages administrators and users
administrators and users to understand the importance of verifying to understand the importance of verifying this association before any
this association before any session is initiated. session is initiated.
There are three cases of man-in-the-middle attacks to consider. There are three cases of man-in-the-middle attacks to consider. The
The first is where an attacker places a device between the client first is where an attacker places a device between the client and the
and the server before the session is initiated. In this case, the server before the session is initiated. In this case, the attack
attack device is trying to mimic the legitimate server and will device is trying to mimic the legitimate server and will offer its
offer its public key to the client when the client initiates a public key to the client when the client initiates a session. If it
session. If it were to offer the public key of the server, then were to offer the public key of the server, then it would not be able
it would not be able to decrypt or sign the transmissions between to decrypt or sign the transmissions between the legitimate server
the legitimate server and the client unless it also had access to and the client unless it also had access to the private-key of the
the private-key of the host. The attack device will also, host. The attack device will also, simultaneously to this, initiate
simultaneously to this, initiate a session to the legitimate a session to the legitimate server masquerading itself as the client.
server masquerading itself as the client. If the public key of If the public key of the server had been securely distributed to the
the server had been securely distributed to the client prior to client prior to that session initiation, the key offered to the
that session initiation, the key offered to the client by the client by the attack device will not match the key stored on the
attack device will not match the key stored on the client. In client. In that case, the user SHOULD be given a warning that the
that case, the user SHOULD be given a warning that the offered offered host key does not match the host key cached on the client.
host key does not match the host key cached on the client. As As described in Section 3.1 of [ARCH], the user may be free to accept
described in Section 3.1 of [ARCH], the user may be free to accept
the new key and continue the session. It is RECOMMENDED that the the new key and continue the session. It is RECOMMENDED that the
warning provide sufficient information to the user of the client warning provide sufficient information to the user of the client
device so they may make an informed decision. If the user chooses device so they may make an informed decision. If the user chooses to
to continue the session with the stored public-key of the server continue the session with the stored public-key of the server (not
(not the public-key offered at the start of the session), then the the public-key offered at the start of the session), then the session
session specific data between the attacker and server will be specific data between the attacker and server will be different
different between the client-to-attacker session and the attacker- between the client-to-attacker session and the attacker-to-server
to-server sessions due to the randomness discussed above. From sessions due to the randomness discussed above. From this, the
this, the attacker will not be able to make this attack work since attacker will not be able to make this attack work since the attacker
the attacker will not be able to correctly sign packets containing will not be able to correctly sign packets containing this session
this session specific data from the server since he does not have specific data from the server since he does not have the private key
the private key of that server. of that server.
The second case that should be considered is similar to the first The second case that should be considered is similar to the first
case in that it also happens at the time of connection but this case in that it also happens at the time of connection but this case
case points out the need for the secure distribution of server points out the need for the secure distribution of server public
public keys. If the server public keys are not securely keys. If the server public keys are not securely distributed then
distributed then the client cannot know if it is talking to the the client cannot know if it is talking to the intended server. An
intended server. An attacker may use social engineering attacker may use social engineering techniques to pass off server
techniques to pass off server keys to unsuspecting users and may keys to unsuspecting users and may then place a man-in-the-middle
then place a man-in-the-middle attack device between the attack device between the legitimate server and the clients. If this
legitimate server and the clients. If this is allowed to happen is allowed to happen then the clients will form client-to-attacker
then the clients will form client-to-attacker sessions and the sessions and the attacker will form attacker-to-server sessions and
attacker will form attacker-to-server sessions and will be able to will be able to monitor and manipulate all of the traffic between the
monitor and manipulate all of the traffic between the clients and clients and the legitimate servers. Server administrators are
the legitimate servers. Server administrators are encouraged to encouraged to make host key fingerprints available for checking by
make host key fingerprints available for checking by some means some means whose security does not rely on the integrity of the
whose security does not rely on the integrity of the actual host actual host keys. Possible mechanisms are discussed in Section 3.1
keys. Possible mechanisms are discussed in Section 3.1 of [SSH- of [SSH-ARCH] and may also include secured Web pages, physical pieces
ARCH] and may also include secured Web pages, physical pieces of of paper, etc. Implementors SHOULD provide recommendations on how
paper, etc. Implementors SHOULD provide recommendations on how best to do this with their implementation. Because the protocol is
best to do this with their implementation. Because the protocol extensible, future extensions to the protocol may provide better
is extensible, future extensions to the protocol may provide mechanisms for dealing with the need to know the server's host key
better mechanisms for dealing with the need to know the server's before connecting. For example, making the host key fingerprint
host key before connecting. For example, making the host key available through a secure DNS lookup, or using kerberos over gssapi
fingerprint available through a secure DNS lookup, or using during key exchange to authenticate the server are possibilities.
kerberos over gssapi during key exchange to authenticate the
server are possibilities.
In the third man-in-the-middle case, attackers may attempt to In the third man-in-the-middle case, attackers may attempt to
manipulate packets in transit between peers after the session has manipulate packets in transit between peers after the session has
been established. As described in the Replay part of this been established. As described in the Replay part of this section, a
section, a successful attack of this nature is very improbable. successful attack of this nature is very improbable. As in the
As in the Replay section, this reasoning does assume that the MAC Replay section, this reasoning does assume that the MAC is secure and
is secure and that it is infeasible to construct inputs to a MAC that it is infeasible to construct inputs to a MAC algorithm to give
algorithm to give a known output. This is discussed in much a known output. This is discussed in much greater detail in Section
greater detail in Section 6 of RFC 2104. If the MAC algorithm has 6 of RFC 2104. If the MAC algorithm has a vulnerability or is weak
a vulnerability or is weak enough, then the attacker may be able enough, then the attacker may be able to specify certain inputs to
to specify certain inputs to yield a known MAC. With that they yield a known MAC. With that they may be able to alter the contents
may be able to alter the contents of a packet in transit. of a packet in transit. Alternatively the attacker may be able to
Alternatively the attacker may be able to exploit the algorithm exploit the algorithm vulnerability or weakness to find the shared
vulnerability or weakness to find the shared secret by reviewing secret by reviewing the MACs from captured packets. In either of
the MACs from captured packets. In either of those cases, an those cases, an attacker could construct a packet or packets that
attacker could construct a packet or packets that could be could be inserted into an SSH stream. To prevent that, implementors
inserted into an SSH stream. To prevent that, implementors are are encouraged to utilize commonly accepted MAC algorithms and
encouraged to utilize commonly accepted MAC algorithms and
administrators are encouraged to watch current literature and administrators are encouraged to watch current literature and
discussions of cryptography to ensure that they are not using a discussions of cryptography to ensure that they are not using a MAC
MAC algorithm that has a recently found vulnerability or weakness. algorithm that has a recently found vulnerability or weakness.
In summary, the use of this protocol without a reliable In summary, the use of this protocol without a reliable association
association of the binding between a host and its host keys is of the binding between a host and its host keys is inherently
inherently insecure and is NOT RECOMMENDED. It may however be insecure and is NOT RECOMMENDED. It may however be necessary in
necessary in non-security critical environments, and will still non-security critical environments, and will still provide protection
provide protection against passive attacks. Implementors of against passive attacks. Implementors of protocols and applications
protocols and applications running on top of this protocol should running on top of this protocol should keep this possibility in mind.
keep this possibility in mind.
8.2.5 Denial-of-service 9.2.5 Denial-of-service
This protocol is designed to be used over a reliable transport. This protocol is designed to be used over a reliable transport. If
If transmission errors or message manipulation occur, the transmission errors or message manipulation occur, the connection is
connection is closed. The connection SHOULD be re-established if closed. The connection SHOULD be re-established if this occurs.
this occurs. Denial of service attacks of this type ("wire Denial of service attacks of this type ("wire cutter") are almost
cutter") are almost impossible to avoid. impossible to avoid.
In addition, this protocol is vulnerable to Denial of Service In addition, this protocol is vulnerable to Denial of Service attacks
attacks because an attacker can force the server to go through the because an attacker can force the server to go through the CPU and
CPU and memory intensive tasks of connection setup and key memory intensive tasks of connection setup and key exchange without
exchange without authenticating. Implementors SHOULD provide authenticating. Implementors SHOULD provide features that make this
features that make this more difficult. For example, only more difficult. For example, only allowing connections from a subset
allowing connections from a subset of IPs known to have valid of IPs known to have valid users.
users.
8.2.6 Covert Channels 9.2.6 Covert Channels
The protocol was not designed to eliminate covert channels. For The protocol was not designed to eliminate covert channels. For
example, the padding, SSH_MSG_IGNORE messages, and several other example, the padding, SSH_MSG_IGNORE messages, and several other
places in the protocol can be used to pass covert information, and places in the protocol can be used to pass covert information, and
the recipient has no reliable way to verify whether such the recipient has no reliable way to verify whether such information
information is being sent. is being sent.
8.2.7 Forward Secrecy 9.2.7 Forward Secrecy
It should be noted that the Diffie-Hellman key exchanges may It should be noted that the Diffie-Hellman key exchanges may provide
provide perfect forward secrecy (PFS). PFS is essentially defined perfect forward secrecy (PFS). PFS is essentially defined as the
as the cryptographic property of a key-establishment protocol in cryptographic property of a key-establishment protocol in which the
which the compromise of a session key or long-term private key compromise of a session key or long-term private key after a given
after a given session does not cause the compromise of any earlier session does not cause the compromise of any earlier session. [ANSI
session. [ANSI T1.523-2001] SSHv2 sessions resulting from a key T1.523-2001] SSHv2 sessions resulting from a key exchange using
exchange using diffie-hellman-group1-sha1 are secure even if diffie-hellman-group1-sha1 are secure even if private keying/
private keying/authentication material is later revealed, but not authentication material is later revealed, but not if the session
if the session keys are revealed. So, given this definition of keys are revealed. So, given this definition of PFS, SSHv2 does have
PFS, SSHv2 does have PFS. It is hoped that all other key exchange PFS. It is hoped that all other key exchange mechanisms proposed and
mechanisms proposed and used in the future will also provide PFS. used in the future will also provide PFS. This property is not
This property is not commuted to any of the applications or commuted to any of the applications or protocols using SSH as a
protocols using SSH as a transport however. The transport layer transport however. The transport layer of SSH provides
of SSH provides confidentiality for password authentication and confidentiality for password authentication and other methods that
other methods that rely on secret data. rely on secret data.
Of course, if the DH private parameters for the client and server Of course, if the DH private parameters for the client and server are
are revealed then the session key is revealed, but these items can revealed then the session key is revealed, but these items can be
be thrown away after the key exchange completes. It's worth thrown away after the key exchange completes. It's worth pointing
pointing out that these items should not be allowed to end up on out that these items should not be allowed to end up on swap space
swap space and that they should be erased from memory as soon as and that they should be erased from memory as soon as the key
the key exchange completes. exchange completes.
8.3 Authentication Protocol 9.3 Authentication Protocol
The purpose of this protocol is to perform client user The purpose of this protocol is to perform client user
authentication. It assumes that this run over a secure transport authentication. It assumes that this run over a secure transport
layer protocol, which has already authenticated the server layer protocol, which has already authenticated the server machine,
machine, established an encrypted communications channel, and established an encrypted communications channel, and computed a
computed a unique session identifier for this session. unique session identifier for this session.
Several authentication methods with different security Several authentication methods with different security
characteristics are allowed. It is up to the server's local characteristics are allowed. It is up to the server's local policy
policy to decide which methods (or combinations of methods) it is to decide which methods (or combinations of methods) it is willing to
willing to accept for each user. Authentication is no stronger accept for each user. Authentication is no stronger than the weakest
than the weakest combination allowed. combination allowed.
The server may go into a "sleep" period after repeated The server may go into a "sleep" period after repeated unsuccessful
unsuccessful authentication attempts to make key search more authentication attempts to make key search more difficult for
difficult for attackers. Care should be taken so that this attackers. Care should be taken so that this doesn't become a
doesn't become a self-denial of service vector. self-denial of service vector.
8.3.1 Weak Transport 9.3.1 Weak Transport
If the transport layer does not provide confidentiality, If the transport layer does not provide confidentiality,
authentication methods that rely on secret data SHOULD be authentication methods that rely on secret data SHOULD be disabled.
disabled. If it does not provide strong integrity protection, If it does not provide strong integrity protection, requests to
requests to change authentication data (e.g. a password change) change authentication data (e.g. a password change) SHOULD be
SHOULD be disabled to prevent an attacker from modifying the disabled to prevent an attacker from modifying the ciphertext
ciphertext without being noticed, or rendering the new without being noticed, or rendering the new authentication data
authentication data unusable (denial of service). unusable (denial of service).
The assumption as stated above that the Authentication Protocol The assumption as stated above that the Authentication Protocol only
only run over a secure transport that has previously authenticated run over a secure transport that has previously authenticated the
the server is very important to note. People deploying SSH are server is very important to note. People deploying SSH are reminded
reminded of the consequences of man-in-the-middle attacks if the of the consequences of man-in-the-middle attacks if the client does
client does not have a very strong a priori association of the not have a very strong a priori association of the server with the
server with the host key of that server. Specifically for the host key of that server. Specifically for the case of the
case of the Authentication Protocol the client may form a session Authentication Protocol the client may form a session to a
to a man-in-the-middle attack device and divulge user credentials man-in-the-middle attack device and divulge user credentials such as
such as their username and password. Even in the cases of their username and password. Even in the cases of authentication
authentication where no user credentials are divulged, an attacker where no user credentials are divulged, an attacker may still gain
may still gain information they shouldn't have by capturing key- information they shouldn't have by capturing key-strokes in much the
strokes in much the same way that a honeypot works. same way that a honeypot works.
8.3.2 Debug messages 9.3.2 Debug messages
Special care should be taken when designing debug messages. These Special care should be taken when designing debug messages. These
messages may reveal surprising amounts of information about the messages may reveal surprising amounts of information about the host
host if not properly designed. Debug messages can be disabled if not properly designed. Debug messages can be disabled (during
(during user authentication phase) if high security is required. user authentication phase) if high security is required.
Administrators of host machines should make all attempts to Administrators of host machines should make all attempts to
compartmentalize all event notification messages and protect them compartmentalize all event notification messages and protect them
from unwarranted observation. Developers should be aware of the from unwarranted observation. Developers should be aware of the
sensitive nature of some of the normal event messages and debug sensitive nature of some of the normal event messages and debug
messages and may want to provide guidance to administrators on messages and may want to provide guidance to administrators on ways
ways to keep this information away from unauthorized people. to keep this information away from unauthorized people. Developers
Developers should consider minimizing the amount of sensitive should consider minimizing the amount of sensitive information
information obtainable by users during the authentication phase in obtainable by users during the authentication phase in accordance
accordance with the local policies. For this reason, it is with the local policies. For this reason, it is RECOMMENDED that
RECOMMENDED that debug messages be initially disabled at the time debug messages be initially disabled at the time of deployment and
of deployment and require an active decision by an administrator require an active decision by an administrator to allow them to be
to allow them to be enabled. It is also RECOMMENDED that a enabled. It is also RECOMMENDED that a message expressing this
message expressing this concern be presented to the administrator concern be presented to the administrator of a system when the action
of a system when the action is taken to enable debugging messages. is taken to enable debugging messages.
8.3.3 Local security policy 9.3.3 Local security policy
Implementer MUST ensure that the credentials provided validate the Implementer MUST ensure that the credentials provided validate the
professed user and also MUST ensure that the local policy of the professed user and also MUST ensure that the local policy of the
server permits the user the access requested. In particular, server permits the user the access requested. In particular, because
because of the flexible nature of the SSH connection protocol, it of the flexible nature of the SSH connection protocol, it may not be
may not be possible to determine the local security policy, if possible to determine the local security policy, if any, that should
any, that should apply at the time of authentication because the apply at the time of authentication because the kind of service being
kind of service being requested is not clear at that instant. For requested is not clear at that instant. For example, local policy
example, local policy might allow a user to access files on the might allow a user to access files on the server, but not start an
server, but not start an interactive shell. However, during the interactive shell. However, during the authentication protocol, it is
authentication protocol, it is not known whether the user will be not known whether the user will be accessing files or attempting to
accessing files or attempting to use an interactive shell, or even use an interactive shell, or even both. In any event, where local
both. In any event, where local security policy for the server security policy for the server host exists, it MUST be applied and
host exists, it MUST be applied and enforced correctly. enforced correctly.
Implementors are encouraged to provide a default local policy and Implementors are encouraged to provide a default local policy and
make its parameters known to administrators and users. At the make its parameters known to administrators and users. At the
discretion of the implementors, this default policy may be along discretion of the implementors, this default policy may be along the
the lines of 'anything goes' where there are no restrictions lines of 'anything goes' where there are no restrictions placed upon
placed upon users, or it may be along the lines of 'excessively users, or it may be along the lines of 'excessively restrictive' in
restrictive' in which case the administrators will have to which case the administrators will have to actively make changes to
actively make changes to this policy to meet their needs. this policy to meet their needs. Alternatively, it may be some
Alternatively, it may be some attempt at providing something attempt at providing something practical and immediately useful to
practical and immediately useful to the administrators of the the administrators of the system so they don't have to put in much
system so they don't have to put in much effort to get SSH effort to get SSH working. Whatever choice is made MUST be applied
working. Whatever choice is made MUST be applied and enforced as and enforced as required above.
required above.
8.3.4 Public key authentication 9.3.4 Public key authentication
The use of public-key authentication assumes that the client host The use of public-key authentication assumes that the client host has
has not been compromised. not been compromised. It also assumes that the private-key of the
server host has not been compromised.
This risk can be mitigated by the use of passphrases on private This risk can be mitigated by the use of passphrases on private keys;
keys; however, this is not an enforceable policy. The use of however, this is not an enforceable policy. The use of smartcards,
smartcards, or other technology to make passphrases an enforceable or other technology to make passphrases an enforceable policy is
policy is suggested. suggested.
The server could require both password and public-key The server could require both password and public-key authentication,
authentication, however, this requires the client to expose its however, this requires the client to expose its password to the
password to the server (see section on password authentication server (see section on password authentication below.)
below.)
8.3.5 Password authentication 9.3.5 Password authentication
The password mechanism as specified in the authentication protocol The password mechanism as specified in the authentication protocol
assumes that the server has not been compromised. If the server assumes that the server has not been compromised. If the server has
has been compromised, using password authentication will reveal a been compromised, using password authentication will reveal a valid
valid username / password combination to the attacker, which may username / password combination to the attacker, which may lead to
lead to further compromises. further compromises.
This vulnerability can be mitigated by using an alternative form This vulnerability can be mitigated by using an alternative form of
of authentication. For example, public-key authentication makes authentication. For example, public-key authentication makes no
no assumptions about security on the server. assumptions about security on the server.
8.3.6 Host based authentication 9.3.6 Host based authentication
Host based authentication assumes that the client has not been Host based authentication assumes that the client has not been
compromised. There are no mitigating strategies, other than to compromised. There are no mitigating strategies, other than to use
use host based authentication in combination with another host based authentication in combination with another authentication
authentication method. method.
8.4 Connection protocol 9.4 Connection protocol
8.4.1 End point security 9.4.1 End point security
End point security is assumed by the connection protocol. If the End point security is assumed by the connection protocol. If the
server has been compromised, any terminal sessions, port server has been compromised, any terminal sessions, port forwarding,
forwarding, or systems accessed on the host are compromised. or systems accessed on the host are compromised. There are no
There are no mitigating factors for this. mitigating factors for this.
If the client end point has been compromised, and the server fails If the client end point has been compromised, and the server fails to
to stop the attacker at the authentication protocol, all services stop the attacker at the authentication protocol, all services
exposed (either as subsystems or through forwarding) will be exposed (either as subsystems or through forwarding) will be
vulnerable to attack. Implementors SHOULD provide mechanisms for vulnerable to attack. Implementors SHOULD provide mechanisms for
administrators to control which services are exposed to limit the administrators to control which services are exposed to limit the
vulnerability of other services. vulnerability of other services.
These controls might include controlling which machines and ports These controls might include controlling which machines and ports can
can be target in 'port-forwarding' operations, which users are be target in 'port-forwarding' operations, which users are allowed to
allowed to use interactive shell facilities, or which users are use interactive shell facilities, or which users are allowed to use
allowed to use exposed subsystems. exposed subsystems.
8.4.2 Proxy forwarding 9.4.2 Proxy forwarding
The SSH connection protocol allows for proxy forwarding of other The SSH connection protocol allows for proxy forwarding of other
protocols such as SNMP, POP3, and HTTP. This may be a concern for protocols such as SNMP, POP3, and HTTP. This may be a concern for
network administrators who wish to control the access of certain network administrators who wish to control the access of certain
applications by users located outside of their physical location. applications by users located outside of their physical location.
Essentially, the forwarding of these protocols may violate site Essentially, the forwarding of these protocols may violate site
specific security policies as they may be undetectably tunneled specific security policies as they may be undetectably tunneled
through a firewall. Implementors SHOULD provide an administrative through a firewall. Implementors SHOULD provide an administrative
mechanism to control the proxy forwarding functionality so that mechanism to control the proxy forwarding functionality so that site
site specific security policies may be upheld. specific security policies may be upheld.
In addition, a reverse proxy forwarding functionality is In addition, a reverse proxy forwarding functionality is available,
available, which again can be used to bypass firewall controls. which again can be used to bypass firewall controls.
As indicated above, end-point security is assumed during proxy As indicated above, end-point security is assumed during proxy
forwarding operations. Failure of end-point security will forwarding operations. Failure of end-point security will compromise
compromise all data passed over proxy forwarding. all data passed over proxy forwarding.
8.4.3 X11 forwarding 9.4.3 X11 forwarding
Another form of proxy forwarding provided by the ssh connection Another form of proxy forwarding provided by the ssh connection
protocol is the forwarding of the X11 protocol. If end-point protocol is the forwarding of the X11 protocol. If end-point
security has been compromised, X11 forwarding may allow attacks security has been compromised, X11 forwarding may allow attacks
against the X11 server. Users and administrators should, as a against the X11 server. Users and administrators should, as a matter
matter of course, use appropriate X11 security mechanisms to of course, use appropriate X11 security mechanisms to prevent
prevent unauthorized use of the X11 server. Implementors, unauthorized use of the X11 server. Implementors, administrators and
administrators and users who wish to further explore the security users who wish to further explore the security mechanisms of X11 are
mechanisms of X11 are invited to read [SCHEIFLER] and analyze invited to read [SCHEIFLER] and analyze previously reported problems
previously reported problems with the interactions between SSH with the interactions between SSH forwarding and X11 in CERT
forwarding and X11 in CERT vulnerabilities VU#363181 and VU#118892 vulnerabilities VU#363181 and VU#118892 [CERT].
[CERT].
X11 display forwarding with SSH, by itself, is not sufficient to X11 display forwarding with SSH, by itself, is not sufficient to
correct well known problems with X11 security [VENEMA]. However, correct well known problems with X11 security [VENEMA]. However, X11
X11 display forwarding in SSHv2 (or other, secure protocols), display forwarding in SSHv2 (or other, secure protocols), combined
combined with actual and pseudo-displays which accept connections with actual and pseudo-displays which accept connections only over
only over local IPC mechanisms authorized by permissions or ACLs, local IPC mechanisms authorized by permissions or ACLs, does correct
does correct many X11 security problems as long as the "none" MAC many X11 security problems as long as the "none" MAC is not used. It
is not used. It is RECOMMENDED that X11 display implementations is RECOMMENDED that X11 display implementations default to allowing
default to allowing display opens only over local IPC. It is display opens only over local IPC. It is RECOMMENDED that SSHv2
RECOMMENDED that SSHv2 server implementations that support X11 server implementations that support X11 forwarding default to
forwarding default to allowing display opens only over local IPC. allowing display opens only over local IPC. On single-user systems
On single-user systems it might be reasonable to default to it might be reasonable to default to allowing local display opens
allowing local display opens over TCP/IP. over TCP/IP.
Implementors of the X11 forwarding protocol SHOULD implement the Implementors of the X11 forwarding protocol SHOULD implement the
magic cookie access checking spoofing mechanism as described in magic cookie access checking spoofing mechanism as described in
[ssh-connect] as an additional mechanism to prevent unauthorized [ssh-connect] as an additional mechanism to prevent unauthorized use
use of the proxy. of the proxy.
9. Intellectual Property Normative References
The IETF takes no position regarding the validity or scope of any [SSH-ARCH]
intellectual property or other rights that might be claimed to Ylonen, T., "SSH Protocol Architecture", I-D
pertain to the implementation or use of the technology described draft-ietf-architecture-15.txt, Oct 2003.
in this document or the extent to which any license under such
rights might or might not be available; neither does it represent
that it has made any effort to identify any such rights.
Information on the IETF's procedures with respect to rights in
standards-track and standards-related documentation can be found
in BCP-11. Copies of claims of rights made available for
publication and any assurances of licenses to be made available,
or the result of an attempt made to obtain a general license or
permission for the use of such proprietary rights by implementers
or users of this specification can be obtained from the IETF
Secretariat.
The IETF has been notified of intellectual property rights claimed [SSH-TRANS]
in regard to some or all of the specification contained in this Ylonen, T., "SSH Transport Layer Protocol", I-D
document. For more information consult the online list of claimed draft-ietf-transport-17.txt, Oct 2003.
rights.
10. Additional Information [SSH-USERAUTH]
Ylonen, T., "SSH Authentication Protocol", I-D
draft-ietf-userauth-18.txt, Oct 2003.
The current document editor is: Darren.Moffat@Sun.COM. Comments [SSH-CONNECT]
on this internet draft should be sent to the IETF SECSH working Ylonen, T., "SSH Connection Protocol", I-D
group, details at: http://ietf.org/html.charters/secsh- draft-ietf-connect-18.txt, Oct 2003.
charter.html
References [SSH-NUMBERS]
Lehtinen, S. and D. Moffat, "SSH Protocol Assigned
Numbers", I-D draft-ietf-secsh-assignednumbers-05.txt, Oct
2003.
[FIPS-186] Federal Information Processing [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Standards Publication, ., "FIPS PUB Requirement Levels", BCP 14, RFC 2119, March 1997.
186, Digital Signature Standard", May
1994.
[FIPS-197] National Institue of Standards and Informative References
Technology, ., "FIPS 197,
Specification for the Advanced
Encryption Standard", November 2001.
[ANSI T1.523-2001] American National Standards Insitute, [FIPS-186]
Inc., "Telecom Glossary 2000", Federal Information Processing Standards Publication,
February 2001. "FIPS PUB 186, Digital Signature Standard", May 1994.
[SCHEIFLER] Scheifler, R., "X Window System : The [FIPS-197]
Complete Reference to Xlib, X National Institue of Standards and Technology, "FIPS 197,
Protocol, Icccm, Xlfd, 3rd edition.", Specification for the Advanced Encryption Standard",
Digital Press ISBN 1555580882, November 2001.
Feburary 1992.
[RFC0854] Postel, J. and J. Reynolds, "Telnet [ANSI T1.523-2001]
Protocol Specification", STD 8, RFC American National Standards Insitute, Inc., "Telecom
854, May 1983. Glossary 2000", February 2001.
[RFC0894] Hornig, C., "Standard for the [SCHEIFLER]
transmission of IP datagrams over Scheifler, R., "X Window System : The Complete Reference
Ethernet networks", STD 41, RFC 894, to Xlib, X Protocol, Icccm, Xlfd, 3rd edition.", Digital
Apr 1984. Press ISBN 1555580882, Feburary 1992.
[RFC1034] Mockapetris, P., "Domain names - [RFC0854] Postel, J. and J. Reynolds, "Telnet Protocol
concepts and facilities", STD 13, RFC Specification", STD 8, RFC 854, May 1983.
1034, Nov 1987.
[RFC1134] Perkins, D., "Point-to-Point Protocol: [RFC0894] Hornig, C., "Standard for the transmission of IP datagrams
A proposal for multi-protocol over Ethernet networks", STD 41, RFC 894, April 1984.
transmission of datagrams over Point-
to-Point links", RFC 1134, Nov 1989.
[RFC1282] Kantor, B., "BSD Rlogin", RFC 1282, [RFC1034] Mockapetris, P., "Domain names - concepts and facilities",
December 1991. STD 13, RFC 1034, November 1987.
[RFC1510] Kohl, J. and C. Neuman, "The Kerberos [RFC1134] Perkins, D., "Point-to-Point Protocol: A proposal for
Network Authentication Service (V5)", multi-protocol transmission of datagrams over
RFC 1510, September 1993. Point-to-Point links", RFC 1134, November 1989.
[RFC1700] Reynolds, J. and J. Postel, "Assigned [RFC1282] Kantor, B., "BSD Rlogin", RFC 1282, December 1991.
Numbers", STD 2, RFC 1700, October
1994.
[RFC1750] Eastlake, D., Crocker, S. and J. [RFC1510] Kohl, J. and B. Neuman, "The Kerberos Network
Schiller, "Randomness Recommendations Authentication Service (V5)", RFC 1510, September 1993.
for Security", RFC 1750, December
1994.
[RFC1766] Alvestrand, H., "Tags for the [RFC1700] Reynolds, J. and J. Postel, "Assigned Numbers", RFC 1700,
Identification of Languages", RFC October 1994.
1766, March 1995.
[RFC1964] Linn, J., "The Kerberos Version 5 GSS- [RFC1750] Eastlake, D., Crocker, S. and J. Schiller, "Randomness
API Mechanism", RFC 1964, June 1996. Recommendations for Security", RFC 1750, December 1994.
[RFC2025] Adams, C., "The Simple Public-Key GSS- [RFC3066] Alvestrand, H., "Tags for the Identification of
API Mechanism (SPKM)", RFC 2025, Languages", BCP 47, RFC 3066, January 2001.
October 1996.
[RFC2085] Oehler, M. and R. Glenn, "HMAC-MD5 IP [RFC1964] Linn, J., "The Kerberos Version 5 GSS-API Mechanism", RFC
Authentication with Replay 1964, June 1996.
Prevention", RFC 2085, February 1997.
[RFC2104] Krawczyk, H., Bellare, M. and R. [RFC2025] Adams, C., "The Simple Public-Key GSS-API Mechanism
(SPKM)", RFC 2025, October 1996.
Canetti, "HMAC: Keyed-Hashing for [RFC2085] Oehler, M. and R. Glenn, "HMAC-MD5 IP Authentication with
Message Authentication", RFC 2104, Replay Prevention", RFC 2085, February 1997.
February 1997.
[RFC2119] Bradner, S., "Key words for use in [RFC2104] Krawczyk, H., Bellare, M. and R. Canetti, "HMAC:
RFCs to Indicate Requirement Levels", Keyed-Hashing for Message Authentication", RFC 2104,
BCP 14, RFC 2119, March 1997. February 1997.
[RFC2246] Dierks, T. and C. Allen, "The TLS [RFC2246] Dierks, T., Allen, C., Treese, W., Karlton, P., Freier, A.
Protocol Version 1.0", RFC 2246, and P. Kocher, "The TLS Protocol Version 1.0", RFC 2246,
January 1999. January 1999.
[RFC2279] Yergeau, F., "UTF-8, a transformation [RFC2279] Yergeau, F., "UTF-8, a transformation format of ISO
format of ISO 10646", RFC 2279, 10646", RFC 2279, January 1998.
January 1998.
[RFC2410] Glenn, R. and S. Kent, "The NULL
Encryption Algorithm and Its Use With
IPsec", RFC 2410, November 1998.
[RFC2434] Narten, T. and H. Alvestrand,
"Guidelines for Writing an IANA
Considerations Section in RFCs", BCP
26, RFC 2434, October 1998.
[RFC2743] Linn, J., "Generic Security Service
Application Program Interface Version
2, Update 1", RFC 2743, January 2000.
[SSH-ARCH] Ylonen, T., "SSH Protocol
Architecture", I-D draft-ietf-
architecture-14.txt, July 2003.
[SSH-TRANS] Ylonen, T., "SSH Transport Layer
Protocol", I-D draft-ietf-transport-
16.txt, July 2003.
[SSH-USERAUTH] Ylonen, T., "SSH Authentication [RFC2410] Glenn, R. and S. Kent, "The NULL Encryption Algorithm and
Protocol", I-D draft-ietf-userauth- Its Use With IPsec", RFC 2410, November 1998.
17.txt, July 2003.
[SSH-CONNECT] Ylonen, T., "SSH Connection Protocol", [RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing an
I-D draft-ietf-connect-17.txt, July IANA Considerations Section in RFCs", BCP 26, RFC 2434,
2003. October 1998.
[SSH-NUMBERS] Lehtinen, S. and D. Moffat, "SSH [RFC2743] Linn, J., "Generic Security Service Application Program
Protocol Assigned Numbers", I-D draft- Interface Version 2, Update 1", RFC 2743, January 2000.
ietf-secsh-assignednumbers-03.txt,
July 2003.
[SCHNEIER] Schneier, B., "Applied Cryptography [SCHNEIER]
Second Edition: protocols algorithms Schneier, B., "Applied Cryptography Second Edition:
and source in code in C", 1996. protocols algorithms and source in code in C", 1996.
[KAUFMAN,PERLMAN,SPECINER] Kaufman, C., Perlman, R. and M. [KAUFMAN,PERLMAN,SPECINER]
Speciner, "Network Security: PRIVATE Kaufman, C., Perlman, R. and M. Speciner, "Network
Communication in a PUBLIC World", Security: PRIVATE Communication in a PUBLIC World", 1995.
1995.
[CERT] CERT Coordination Center, The., [CERT] CERT Coordination Center, The., "http://www.cert.org/nav/
"http://www.cert.org/nav/index_red.html" index_red.html".
.
[VENEMA] Venema, W., "Murphy's Law and Computer [VENEMA] Venema, W., "Murphy's Law and Computer Security",
Security", Proceedings of 6th USENIX Proceedings of 6th USENIX Security Symposium, San Jose CA
Security Symposium, San Jose CA http://www.usenix.org/publications/library/proceedings/
http://www.usenix.org/publications/library/proceedings/sec96/venema.html sec96/venema.html, July 1996.
, July 1996.
[ROGAWAY] Rogaway, P., "Problems with Proposed [ROGAWAY] Rogaway, P., "Problems with Proposed IP Cryptography",
IP Cryptography", Unpublished paper Unpublished paper http://www.cs.ucdavis.edu/~rogaway/
http://www.cs.ucdavis.edu/~rogaway/papers/draft-rogaway-ipsec-comments-00.txt papers/draft-rogaway-ipsec-comments-00.txt, 1996.
, 1996.
[DAI] Dai, W., "An attack against SSH2 [DAI] Dai, W., "An attack against SSH2 protocol", Email to the
protocol", Email to the SECSH Working SECSH Working Group ietf-ssh@netbsd.org ftp://
Group ietf-ssh@netbsd.org ftp.ietf.org/ietf-mail-archive/secsh/2002-02.mail, Feb
ftp://ftp.ietf.org/ietf-mail- 2002.
archive/secsh/2002-02.mail, Feb 2002.
[BELLARE,KOHNO,NAMPREMPRE] Bellaire, M., Kohno, T. and C. [BELLARE,KOHNO,NAMPREMPRE]
Namprempre, "Authenticated Encryption Bellaire, M., Kohno, T. and C. Namprempre, "Authenticated
in SSH: Fixing the SSH Binary Packet Encryption in SSH: Fixing the SSH Binary Packet Protocol",
Protocol", , Sept 2002. , Sept 2002.
Authors' Addresses Authors' Addresses
Tatu Ylonen Tatu Ylonen
SSH Communications Security Corp SSH Communications Security Corp
Fredrikinkatu 42 Fredrikinkatu 42
HELSINKI FIN-00100 HELSINKI FIN-00100
Finland Finland
EMail: ylo@ssh.com EMail: ylo@ssh.com
Tero Kivinen
SSH Communications Security Corp
Fredrikinkatu 42
HELSINKI FIN-00100
Finland
EMail: kivinen@ssh.com Darren J. Moffat (editor)
Sun Microsystems, Inc
17 Network Circle
Menlo Park CA 94025
USA
Markku-Juhani O. Saarinen EMail: Darren.Moffat@Sun.COM
University of Jyvaskyla
Timo J. Rinne Intellectual Property Statement
SSH Communications Security Corp
Fredrikinkatu 42
HELSINKI FIN-00100
Finland
EMail: tri@ssh.com The IETF takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to
pertain to the implementation or use of the technology described in
this document or the extent to which any license under such rights
might or might not be available; neither does it represent that it
has made any effort to identify any such rights. Information on the
IETF's procedures with respect to rights in standards-track and
standards-related documentation can be found in BCP-11. Copies of
claims of rights made available for publication and any assurances of
licenses to be made available, or the result of an attempt made to
obtain a general license or permission for the use of such
proprietary rights by implementors or users of this specification can
be obtained from the IETF Secretariat.
Sami Lehtinen The IETF invites any interested party to bring to its attention any
SSH Communications Security Corp copyrights, patents or patent applications, or other proprietary
Fredrikinkatu 42 rights which may cover technology that may be required to practice
HELSINKI FIN-00100 this standard. Please address the information to the IETF Executive
Finland Director.
EMail: sjl@ssh.com The IETF has been notified of intellectual property rights claimed in
regard to some or all of the specification contained in this
document. For more information consult the online list of claimed
rights.
Full Copyright Statement Full Copyright Statement
Copyright (C) The Internet Society (2003). All Rights Reserved. Copyright (C) The Internet Society (2003). All Rights Reserved.
This document and translations of it may be copied and furnished This document and translations of it may be copied and furnished to
to others, and derivative works that comment on or otherwise others, and derivative works that comment on or otherwise explain it
explain it or assist in its implementation may be prepared, or assist in its implementation may be prepared, copied, published
copied, published and distributed, in whole or in part, without and distributed, in whole or in part, without restriction of any
restriction of any kind, provided that the above copyright notice kind, provided that the above copyright notice and this paragraph are
and this paragraph are included on all such copies and derivative included on all such copies and derivative works. However, this
works. However, this document itself may not be modified in any document itself may not be modified in any way, such as by removing
way, such as by removing the copyright notice or references to the the copyright notice or references to the Internet Society or other
Internet Society or other Internet organizations, except as needed Internet organizations, except as needed for the purpose of
for the purpose of developing Internet standards in which case the developing Internet standards in which case the procedures for
procedures for copyrights defined in the Internet Standards copyrights defined in the Internet Standards process must be
process must be followed, or as required to translate it into followed, or as required to translate it into languages other than
languages other than English. English.
The limited permissions granted above are perpetual and will not The limited permissions granted above are perpetual and will not be
be revoked by the Internet Society or its successors or assigns. revoked by the Internet Society or its successors or assignees.
This document and the information contained herein is provided on This document and the information contained herein is provided on an
an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement Acknowledgment
Funding for the RFC Editor function is currently provided by the Funding for the RFC Editor function is currently provided by the
Internet Society. Internet Society.
 End of changes. 

This html diff was produced by rfcdiff 1.23, available from http://www.levkowetz.com/ietf/tools/rfcdiff/