<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <cite xml:lang="en">RFC 7457 - Summarizing Known Attacks on Transport Layer Security (TLS) and Datagram TLS (DTLS)</cite>
(<time>2015-02-24 18:52:35 +09:00</time> 版)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://tools.ietf.org/html/rfc7457#section-2.2">https://tools.ietf.org/html/rfc7457#section-2.2</anchor-external></figcaption><blockquote><p>Similarly, there are attacks on the transition between unprotected</p><p>and TLS-protected traffic.  A number of IETF application protocols</p><p>have used an application-level command, usually STARTTLS, to upgrade</p><p>a cleartext connection to use TLS.  Multiple implementations of</p><p>STARTTLS had a flaw where an application-layer input buffer retained</p><p>commands that were pipelined with the STARTTLS command, such that</p><p>commands received prior to TLS negotiation are executed after TLS</p><p>negotiation.  This problem is resolved by requiring the application-</p><p>level command input buffer to be empty before negotiating TLS.  Note</p><p>that this flaw lives in the application layer code and does not</p><p>impact the TLS protocol directly.</p><p>STARTTLS and similar mechanisms are vulnerable to downgrade attacks,</p><p>whereby the attacker simply removes the STARTTLS indication from the</p><p>(unprotected) request.  This cannot be mitigated unless HSTS-like</p><p>solutions are added.</p></blockquote></figure><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">IETF</anchor> は <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC 2817</anchor> で本方式を <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Upgrade:</anchor> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">TLS</anchor></code>
という形で <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HTTP</anchor> に持ち込むことを企てましたが、支持されませんでした。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[3]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">IETF</anchor> は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ポート番号</anchor>の枯渇を懸念して、 <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HTTP</anchor> と <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HTTPS</anchor> のように異なる<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ポート</anchor>を使う方法よりも
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">STARTTLS</anchor> のような<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">命令</anchor>を<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">アプリケーション層プロトコル</anchor>に含める方式が望ましいとしているようです。</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">TLS</anchor> も参照。</comment-p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[4]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">STARTTLS</anchor> 方式は転送路とアプリケーションを分離する階層化された設計を否定する、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">layering violation</anchor> のようにも思えます。
アプリケーションプロトコル内部で平文モードから <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">TLS</anchor> モードや
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">TLS</anchor> モードから平文モードへの切り替えを実装しなければならないため、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">セキュリティー</anchor>上の問題をプロトコルや実装に生じさせてしまう例が実際にあったと
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC 7472</anchor> は述べています。そうでなくても、広義の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ソケット層</anchor>の <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">TLS</anchor>
と<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">アプリケーション層</anchor>で比較的綺麗にモジュール化できたはずのアプリケーション層プロトコルの実装が
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">STARTTLS</anchor> 方式では複雑になってしまいます。</p><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[5]</anchor-end> <cite xml:lang="en">RFC 7525 - Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)</cite>
(<time>2015-05-29 03:22:56 +09:00</time> 版)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://tools.ietf.org/html/rfc7525#section-3.2">https://tools.ietf.org/html/rfc7525#section-3.2</anchor-external></figcaption><blockquote><p>In cases where an application protocol allows implementations or</p><p>deployments a choice between strict TLS configuration and dynamic</p><p>upgrade from unencrypted to TLS-protected traffic (such as</p><p>STARTTLS), clients and servers SHOULD prefer strict TLS</p><p>configuration.</p></blockquote></figure><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="6" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[6]</anchor-end> <cite xml:lang="en">RFC 7472 - Internet Printing Protocol (IPP) over HTTPS Transport Binding and the 'ipps' URI Scheme</cite>
(<time>2015-05-25 01:18:35 +09:00</time> 版)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://tools.ietf.org/html/rfc7472">https://tools.ietf.org/html/rfc7472</anchor-external></figcaption><blockquote><p>1) Some existing IPP Client and IPP Printer implementations of</p><p>&quot;Upgrading to TLS Within HTTP/1.1&quot; <strong>[</strong>RFC2817<strong>]</strong> are flawed and</p><p>unreliable, although this is not due to specification defects in</p><p><strong>[</strong>RFC2817<strong>]</strong> itself.</p><p>2) Some existing IPP Client and IPP Printer implementations of HTTP</p><p>upgrade <strong>[</strong>RFC2817<strong>]</strong> do not perform an upgrade at the beginning of</p><p>every HTTP <strong>[</strong>RFC7230<strong>]</strong> connection; instead, they only shift to</p><p>secure IPP for selected IPP operations (inherently dangerous</p><p>behavior on the same underlying TCP <strong>[</strong>RFC793<strong>]</strong> connection).</p><p>3) IPP Printer server-mandated HTTP upgrade <strong>[</strong>RFC2817<strong>]</strong> can still lead</p><p>to exposure of IPP Client data if the Expect request header is not</p><p>used -- basically, the IPP Client can send its whole Print-Job</p><p>request before the IPP Printer has a chance to respond and say,</p><p>&quot;Wait!  You need to encrypt first!&quot;.</p></blockquote></figure><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[7]</anchor-end> <cite xml:lang="en">RFC 7525 - Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)</cite>
(<time>2015-05-29 03:22:56 +09:00</time> 版)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://tools.ietf.org/html/rfc7525#section-3.2">https://tools.ietf.org/html/rfc7525#section-3.2</anchor-external></figcaption><blockquote><p>Application protocols typically provide a way for the server to</p><p>offer TLS during an initial protocol exchange, and sometimes also</p><p>provide a way for the server to advertise support for TLS (e.g.,</p><p>through a flag indicating that TLS is required); unfortunately,</p><p>these indications are sent before the communication channel is</p><p>encrypted.  A client SHOULD attempt to negotiate TLS even if these</p><p>indications are not communicated by the server.</p></blockquote></figure><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="8" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[8]</anchor-end> 
<cite xml:lang="ja">認証メールを送るときには、587(starttls)じゃなくて、465(smtps)を使おう</cite>, <time>2024-12-04T07:23:06.000Z</time> <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://zenn.dev/bitcat/articles/4f2c7d717b3053">https://zenn.dev/bitcat/articles/4f2c7d717b3053</anchor-external></p></body></html>