Skip to content

zlib upgrade broke known vectors #50138

@panva

Description

@panva

See nodejs/citgm#1011

node -p 'process.versions.zlib'
1.2.13.1-motley
node -v
v18.18.1
node -e "result = zlib.deflateRawSync('You can trust us to stick with you through thick and thin–to the bitter end. And you can trust us to keep any secret of yours–closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo.'); console.log(result); console.log(result.byteLength)"
<Buffer 6d 8f c1 0d c2 30 0c 45 57 f9 03 54 dd 01 0e ac 80 38 a6 a9 43 a2 46 31 72 1c 55 bd b1 03 1b 32 09 6e 2a 0e 48 9c 1c f9 ff ff fc 73 e3 06 ef 0a 54 5a ... 120 more bytes>
170
./node -p 'process.versions.zlib'
1.2.13.1-motley
➜  node git:(0522ac086c) ./node -e "result = zlib.deflateRawSync('You can trust us to stick with you through thick and thin–to the bitter end. And you can trust us to keep any secret of yours–closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo.'); console.log(result); console.log(result.byteLength)"
<Buffer 5d 8f c1 0d 42 31 0c 43 57 f1 00 e8 ef 00 07 56 40 1c 4b 9b d2 8a 2a 41 a9 2b c4 8d 1d d8 90 49 d0 2f e2 00 b7 28 b6 5f 9c a3 0d c4 a0 a0 8f 4e 8c 0e ... 118 more bytes>
168

I suggest to revert the following commits and add unit tests for more known vectors to prevent breaking updates in the future.

cc @alfonsograziano @lpinca @aduh95

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency file.invalidIssues and PRs that are invalid.zlibIssues and PRs related to the zlib subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions