Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zlib: gracefully set windowBits from 8 to 9 #16511

Merged
merged 2 commits into from
Oct 29, 2017

Commits on Oct 29, 2017

  1. zlib: gracefully set windowBits from 8 to 9

    On 4 April 2017, Node.js versions v4.8.2 and v6.10.2 were
    released. These versions bumped the vendored zlib library from
    v1.2.8 to v1.2.11 in response to what it describes as low-severity
    CVEs. In zlib v1.2.9, a change was made that causes an error to be
    raised when a raw deflate stream is initialised with windowBits set
    to 8.
    
    In zlib v1.2.9, 8 become an invalid value for this parameter, and Node's zlib
    module will crash if you call this:
    
    ```
    zlib.createDeflateRaw({windowBits: 8})
    ```
    
    On some versions this crashes Node and you cannot recover from it, while on some
    versions it throws an exception. The permessage-deflate library up to
    version v0.1.5 does make such a call with no try/catch
    
    This commit reverts to the original behavior of zlib by gracefully changed
    windowBits: 8 to windowBits: 9 for raw deflate streams.
    
    Original-PR-URL: nodejs-private/node-private#95
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Evan Lucas <evanlucas@me.com>
    Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
    Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
    
    PR-URL: nodejs#16511
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
    Reviewed-By: Refael Ackermann <refack@gmail.com>
    MylesBorins authored and addaleax committed Oct 29, 2017
    2 Configuration menu
    Copy the full SHA
    241eb61 View commit details
    Browse the repository at this point in the history
  2. doc: more accurate zlib windowBits information

    Fixes: nodejs#14847
    PR-URL: nodejs#16511
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
    Reviewed-By: Refael Ackermann <refack@gmail.com>
    addaleax committed Oct 29, 2017
    Configuration menu
    Copy the full SHA
    25ef9d2 View commit details
    Browse the repository at this point in the history