From f9540e53e72c3b455708a05e5ff5c7a552a5a733 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Wed, 10 Feb 2016 15:45:47 +0100 Subject: [PATCH] Fix #15: prevent ISO-2022-JP encoder attack --- Overview.html | 12 +++++++++++- Overview.src.html | 10 ++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Overview.html b/Overview.html index e1bca46..3a0031c 100644 --- a/Overview.html +++ b/Overview.html @@ -7,7 +7,7 @@

Encoding

-

Living Standard — Last Updated 10 February 2016

+

Living Standard — Last Updated 12 February 2016

Participate: @@ -2314,6 +2314,15 @@

13.2.2 ISO-2022-JP ISO-2022-JP encoder state is ASCII, return finished. +
  • +

    If ISO-2022-JP encoder state is + ASCII or + Roman, and code point is U+000E, U+000F, + or U+001B, return error with U+FFFD. + +

    This returns U+FFFD rather than the code point to prevent attacks. + +

  • If ISO-2022-JP encoder state is ASCII and code point is an ASCII code point, return a byte whose value is code point. @@ -2904,6 +2913,7 @@

    Acknowledgments

    Simon Montagu, Simon Pieters, Simon Sapin, +寺田健 (Takeshi Terada), Vyacheslav Matva, and 成瀬ゆい (Yui Naruse) for being awesome. diff --git a/Overview.src.html b/Overview.src.html index 3a34017..d66d955 100644 --- a/Overview.src.html +++ b/Overview.src.html @@ -2228,6 +2228,15 @@

    ISO-2022-JP encoder

    ISO-2022-JP encoder state is ASCII, return finished. +
  • +

    If ISO-2022-JP encoder state is + ASCII or + Roman, and code point is U+000E, U+000F, + or U+001B, return error with U+FFFD. + +

    This returns U+FFFD rather than the code point to prevent attacks. + +

  • If ISO-2022-JP encoder state is ASCII and code point is an ASCII code point, return a byte whose value is code point. @@ -2797,6 +2806,7 @@

    Acknowledgments

    Simon Montagu, Simon Pieters, Simon Sapin, +寺田健 (Takeshi Terada), Vyacheslav Matva, and 成瀬ゆい (Yui Naruse) for being awesome.