<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.6.35 (Ruby 3.0.2) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-damjanovic-websockets-nomasking-01" category="exp" version="3">
  <!-- xml2rfc v2v3 conversion 3.17.4 -->
  <front>
    <title>WebSocket Extension to disable masking</title>
    <seriesInfo name="Internet-Draft" value="draft-damjanovic-websockets-nomasking-01"/>
    <author initials="D." surname="Damjanovic" fullname="Dragana Damjanovic">
      <organization>Microsoft</organization>
      <address>
        <email>dragana.damjano@gmail.com</email>
      </address>
    </author>
    <date year="2023" month="July" day="05"/>
    <area>ART</area>
    <workgroup>HTTP</workgroup>
    <keyword>Internet-Draft</keyword>
    <abstract>
      <?line 22?>

<t>The WebSocket protocol specifies that all frames sent from the client to the
server must be masked. This was introduced as a protection against a possible
attack on the infrastructure. With careful consideration, the masking could be
omitted when intermediaries do not have access to the unencrypted traffic.</t>
      <t>This specification introduces a WebSocket extension that disables the mandatory
masking of frames sent from the client to the server. The extension is allowed
only if the client uses an encrypted connection.</t>
    </abstract>
  </front>
  <middle>
    <?line 33?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>The WebSocket protocol specifies that all frames sent from the client to the
server must be masked <xref target="RFC6455"/>. This was introduced as a protection against
a possible attack on the infrastructure described in <xref section="10.3" sectionFormat="of" target="RFC6455"/>. The attack can be performed on intermediaries, such as proxies and
it could cause cache poisoning. Using end-to-end encryption, the attack can be
mitigated without the use of masking. This is because every intermediary will
be denied access to the unencrypted traffic, which prevents the caching attack.
The masking has been made mandatory for the connection using TLS to protect the
infrastructure that is behind TLS terminating proxies.</t>
      <t>This specification introduces a WebSocket extension that disables the masking
of frames sent from the client to the server. The support for the extension
will be advertised by the client (see <xref section="9" sectionFormat="of" target="RFC6455"/>). The server
may accept or decline the extension. The client can advertise the extension
only if an encrypted connection.</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      <?line -18?>

</section>
    <section anchor="the-no-masking-extension">
      <name>The "no-masking" extension</name>
      <t>The "no-masking" extension is negotiated using the WebSocket extension
mechanism described in <xref section="9" sectionFormat="of" target="RFC6455"/>. The client advertises support
for the extension by sending "no-masking" in the list of supported extensions
sent in the "Sec-WebSocket-Extensions" header field. The server accepts the
extension, by sending "no-masking" in the "Sec-WebSocket-Extensions" header
value.</t>
      <t>The client <bcp14>MUST NOT</bcp14> send the extension if a non-secure connection is used.</t>
      <t>If the "no-masking" extension is negotiated the client and the server behavior
are:</t>
      <ul spacing="normal">
        <li>The client <bcp14>MUST</bcp14> send data to the server without masking. The client sets the
field "frame-masked" to 0 on all frames. As defined in <xref target="RFC6455"/>, the field
"frame-masking-key" will not be present.</li>
        <li>The server must only accept frames with the field "frame-masked" set to 0.
If the server receives a frame with the field "frame-masked" set to 1, it <bcp14>MUST</bcp14>
close the connection with the status code 1002 define in <xref section="7.4.1" sectionFormat="of" target="RFC6455"/>.</li>
      </ul>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>TBA</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>IANA has registered the following WebSocket extension name in the "WebSocket
Extension Name Registry" defined in <xref target="RFC6455"/>.</t>
      <t>Extension Identifier: no-masking</t>
      <t>Extension Common Name: Disable the WebSocket client-to-server masking</t>
      <t>Extension Definition: This document.</t>
      <t>Known Incompatible Extensions: None</t>
      <t>The "no-masking" extension name is used in the "Sec-WebSocket-Extensions"
header in the WebSocket opening handshake to negotiate disabling of the
client-to-server masking.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>Normative References</name>
      <reference anchor="RFC6455" target="https://www.rfc-editor.org/info/rfc6455" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6455.xml">
        <front>
          <title>The WebSocket Protocol</title>
          <author fullname="I. Fette" initials="I." surname="Fette"/>
          <author fullname="A. Melnikov" initials="A." surname="Melnikov"/>
          <date month="December" year="2011"/>
          <abstract>
            <t>The WebSocket Protocol enables two-way communication between a client running untrusted code in a controlled environment to a remote host that has opted-in to communications from that code. The security model used for this is the origin-based security model commonly used by web browsers. The protocol consists of an opening handshake followed by basic message framing, layered over TCP. The goal of this technology is to provide a mechanism for browser-based applications that need two-way communication with servers that does not rely on opening multiple HTTP connections (e.g., using XMLHttpRequest or s and long polling). [STANDARDS-TRACK]</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="6455"/>
        <seriesInfo name="DOI" value="10.17487/RFC6455"/>
      </reference>
      <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner"/>
          <date month="March" year="1997"/>
          <abstract>
            <t>In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized.  This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba" initials="B." surname="Leiba"/>
          <date month="May" year="2017"/>
          <abstract>
            <t>RFC 2119 specifies common key words that may be used in protocol specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
    </references>
    <?line 120?>

<section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA71X224bNxB951dM1Zc28AqS6zSJkCZVbBc26ktqywiCog8U
l5JY75ILkmtHDfwv/ZZ+WWdIai9yHCdAUcOwd3mZy5kzl82yjHnlCzmBwTs5
vzTiWno4/OCldspo8AZy5fi8kFByd630csByIzQv8UZu+cJnOS//5NrcKJHd
yrkLElymTTqfjcZMcC+Xxq4nID9UjKnKTsDb2vnd0ejFaJdxK/kEphczdmvs
9dKauprA0Wz2ll3LNS7lEzjWXlotfXZAShnjtV8ZO2GQMcCfaBDuLbnmcNCY
FDaNxVX1F/fo0QROlbDGGRRCe7Lkqgiu0M1hcubnJS0PhSkZ08aWePVGTtBy
vei8sSzLgM+dt1ygSbOVhBbDyhpvhCnAVVKohZIO/Ip74EUBC4vmOnBSe3w2
Je5IEIWid0Qc35iT9kZaKBEkmEfwZT6E2Uo5uOUOlPbW5LWQOeAbD+qkIA8B
PVEar+GicU5h7Bj3notroICiJvTCcrS6Fr62cgjvlF+BwCAs6gKEwcjn0ga0
dsL5FEncqoscrWGmVN6j5tuV1GSJtKXMFbfkZG5AGw8rfiOBCyGdSy5B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