SSH IUTF8: IUTF8 Terminal Mode in Secure Shell (SSH)
A new SSH terminal mode opcode that tells the server a terminal is using UTF-8.
Tatham, S. and D. Tucker, "IUTF8 Terminal Mode in Secure Shell (SSH)", RFC 8160, DOI 10.17487/RFC8160, April 2017, <https://www.rfc-editor.org/info/rfc8160>.
@misc{rfc8160,
series = {Request for Comments},
number = 8160,
howpublished = {RFC 8160},
publisher = {RFC Editor},
doi = {10.17487/RFC8160},
url = {https://www.rfc-editor.org/info/rfc8160},
author = {S. Tatham and D. Tucker},
title = {{IUTF8 Terminal Mode in Secure Shell (SSH)}},
pagetotal = 4,
year = 2017,
month = apr,
} RFC text
Contents
Internet Engineering Task Force (IETF) S. Tatham
Request for Comments: 8160 PuTTY
Category: Standards Track D. Tucker
ISSN: 2070-1721 OpenSSH
April 2017
IUTF8 Terminal Mode in Secure Shell (SSH)
Abstract
This document specifies a new opcode in the Secure Shell terminal
modes encoding. The new opcode describes the widely used IUTF8
terminal mode bit, which indicates that terminal I/O uses UTF-8
character encoding.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in Section 2 of RFC 7841.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
http://www.rfc-editor.org/info/rfc8160.
Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Conventions Used in This Document . . . . . . . . . . . . . . 2
3. New IUTF8 Opcode for Terminal Mode Encoding . . . . . . . . . 2
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 3
5. Security Considerations . . . . . . . . . . . . . . . . . . . 3
6. References . . . . . . . . . . . . . . . . . . . . . . . . . 3
6.1. Normative References . . . . . . . . . . . . . . . . . . 3
6.2. Informative References . . . . . . . . . . . . . . . . . 3
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 4
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 4
1. Introduction
The Secure Shell (SSH) connection protocol [RFC4254] provides an
encoding for terminal modes, used in the "pty-req" channel request
type.
A commonly used terminal mode is IUTF8, which indicates that the
terminal driver should assume that terminal I/O uses the UTF-8
character encoding [RFC3629]. This is typically used by the kernel's
terminal driver on the server to decide how many bytes of input to
treat as a single logical character during line editing.
SSH does not currently provide an encoding for IUTF8. This document
specifies one.
2. Conventions Used in This Document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119].
3. New IUTF8 Opcode for Terminal Mode Encoding
The opcode value 42 is defined for the IUTF8 terminal mode.
As specified in Section 8 of [RFC4254], all opcodes in the range 1 to
159 have a single uint32 argument; therefore, the IUTF8 opcode is
followed by a single uint32 argument. The value 0 indicates that the
IUTF8 mode is disabled, and the value 1 indicates that it is enabled.
As with all other encoded terminal modes, the client SHOULD transmit
a value for this mode if it knows about one, and the server MAY
ignore it.
4. IANA Considerations
This document augments the list of "Pseudo-Terminal Encoded Terminal
Modes" defined in Section 8 of [RFC4254].
IANA has added the following opcode to the "Pseudo-Terminal Encoded
Terminal Modes" registry:
opcode mnemonic description
------ -------- -----------
42 IUTF8 Terminal input and output is assumed to be
encoded in UTF-8.
5. Security Considerations
The security considerations of [RFC4254] apply. This additional
terminal mode encoding is believed to have no security implications
differing from the existing set of encoded terminal modes.
Since the IUTF8 terminal mode is intended for use in conjunction with
the UTF-8 character encoding, the security considerations of
[RFC3629] also apply to systems in which this mode is enabled. In
particular, terminal drivers that interpret this bit as enabling
UTF-8-aware line-editing behavior should carefully consider how that
behavior will treat illegal sequences, overlong encodings, and
redundant representations of composed characters (see [UNICODE]).
6. References
6.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997,
<http://www.rfc-editor.org/info/rfc2119>.
[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO
10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November
2003, <http://www.rfc-editor.org/info/rfc3629>.
[RFC4254] Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH)
Connection Protocol", RFC 4254, DOI 10.17487/RFC4254,
January 2006, <http://www.rfc-editor.org/info/rfc4254>.
6.2. Informative References
[UNICODE] The Unicode Consortium, "The Unicode Standard",
<http://www.unicode.org/versions/latest/>.
Acknowledgements
The authors are indebted to Colin Watson for originally suggesting
this terminal mode in 2005, and David Madore and Jakub Jelen for
prior implementation efforts.
Authors' Addresses
Simon Tatham
PuTTY
Email: anakin@pobox.com
Darren Tucker
OpenSSH
Email: dtucker@openssh.com
AI ELI5
On this page
§1The Missing Terminal Mode
The SSH connection protocol (RFC 4254) encodes terminal modes for the pty-req channel request. A commonly used mode, IUTF8, tells the terminal driver to assume terminal I/O uses UTF-8.
It is typically used by the kernel's terminal driver on the server to decide how many bytes of input to treat as one logical character during line editing. SSH had no encoding for it until this document.
Some letters take more than one byte. The server needs to know your terminal is using these, so it does not cut a letter in half when you press backspace.
§2Opcode 42
The opcode value 42 is defined for IUTF8. As RFC 4254 specifies for opcodes 1 to 159, it is followed by a single uint32 argument. The value 0 means the mode is disabled and 1 means enabled.
As with every encoded terminal mode, the client SHOULD transmit a value if it knows about the mode, and the server MAY ignore it.
Your computer sends a note numbered 42 with a yes or a no. The other computer may choose to ignore the note.
- 42IUTF8 — Terminal input and output assumed to be UTF-8; followed by one uint32 argument.
- 0Argument: disabled — IUTF8 mode is off.
- 1Argument: enabled — IUTF8 mode is on.
§3IANA and Security
IANA added opcode 42, mnemonic IUTF8, to the Pseudo-Terminal Encoded Terminal Modes registry, described as terminal input and output being assumed to be encoded in UTF-8.
The security considerations of RFC 4254 apply, and the mode is believed to add no new implications. Because it goes with UTF-8, the UTF-8 considerations also apply: terminal drivers using the bit for UTF-8-aware line editing should consider how they treat illegal sequences, overlong encodings and redundant representations of composed characters.
The new note adds no new danger, but a terminal that understands UTF-8 should be careful with broken or oddly written letters.