Re: [hybi] deflate-stream and masking

Greg Wilkins <> Wed, 20 July 2011 02:34 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 2368511E809C for <>; Tue, 19 Jul 2011 19:34:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.795
X-Spam-Status: No, score=-2.795 tagged_above=-999 required=5 tests=[AWL=0.182, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-1]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id fAZwNJBhPgxY for <>; Tue, 19 Jul 2011 19:34:41 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 82B4811E808B for <>; Tue, 19 Jul 2011 19:34:41 -0700 (PDT)
Received: by vws12 with SMTP id 12so4449040vws.31 for <>; Tue, 19 Jul 2011 19:34:40 -0700 (PDT)
MIME-Version: 1.0
Received: by with SMTP id br17mr4061711vdc.107.1311129280427; Tue, 19 Jul 2011 19:34:40 -0700 (PDT)
Received: by with HTTP; Tue, 19 Jul 2011 19:34:40 -0700 (PDT)
In-Reply-To: <>
References: <>
Date: Wed, 20 Jul 2011 12:34:40 +1000
Message-ID: <>
From: Greg Wilkins <>
To: Hybi <>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Subject: Re: [hybi] deflate-stream and masking
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Server-Initiated HTTP <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Wed, 20 Jul 2011 02:34:42 -0000

I've just noticed that the w3c is currently intending to make support
for deflate-stream mandatory!

This moves this extension from being useless, but mostly harmless, to
being a major impost on servers and intermediaries.
If the browser make this mandatory, then servers will obviously have
to support it at a cost of extra CPU, extra buffers but for no
significant savings in bandwidth.
Intermediaries that wish to act on frame boundaries will also have to
implement it.

This illustrate that having silly options always puts you at risk of
people taking you up on those options.

This extension is demonstrably broken and needs to be either fixed or removed.


On 20 June 2011 16:33, Greg Wilkins <> wrote:
> As part of my continuing campaign against including deflate-stream in
> the specification as a standard extension, I did a quick test of how
> well it works when applied to masked frames.
> I took a days worth of traffic from an IRC channel and wrapped it up
> as JSON messages sent as websocket frames.
> There were 487 message that looked like:
>     {channel:"#webtide", username:"tbecker", text:"joakime: jenkins
> had issues pulling from github a couple of times  last week"}
> As an unmasked WS stream, it was 50675 bytes, and as a masked stream
> is was 52623 bytes.
> I then compressed both these streams with gzip and got 13306 bytes for
> unmasked and 51704 bytes for the masked!!!!
> So for this very typical example, masking was sufficiently random to
> completely negate the benefits of compression.
> So the deflate-stream "extension" is:
>  + next to useless for inbound traffic
>  + breaks all the rules of what an extension can do
>  + is potentially vulnerable to injection as attackers can send
> repeated patterns that may subvert masking
>  + can be replaced by the in-frame compression extension already proposed.
>  + was inserted in the draft with little or no discussion and without
> clear consensus.
> Can I call for a straw poll of who wants to keep this extension in the spec?
> regards