mirror of
https://github.com/curl/curl.git
synced 2025-08-31 01:15:10 +03:00
This started out as regression tests for the `curl_ws_recv()` and `curl_ws_send()` implementation and ended up with a bugfix, additional protocol validation and minor logging improvements. - Fix reset of fragmented message decoder state when a PING/PONG is received in between message fragments. - Fix undefined behavior (applying zero offset to null pointer) in curl_ws_send() when the given buffer is NULL. - Detect invalid overlong PING/PONG/CLOSE frames. - Detect invalid fragmented PING/PONG/CLOSE frames. - Detect invalid sequences of fragmented frames. - a) A continuation frame (0x80...) is received without any ongoing fragmented message. - b) A new fragmented message is started (0x81/0x01/0x82/0x02...) before the ongoing fragmented message has terminated. - Made logs for invalid opcodes easier to understand. - Moved noisy logs to the `CURL_TRC_WS` log level. - Unified the prefixes for WebSocket log messages: `[WS] ...` - Add env var `CURL_WS_FORCE_ZERO_MASK` in debug builds. - If set, it forces the bit mask applied to outgoing payloads to 0x00000000, which effectively means the payload is not masked at all. This drastically simplifies defining the expected `<protocol>` data in test cases. - 2700: Frame types - 2701: Invalid opcode 0x3 - 2702: Invalid opcode 0xB - 2703: Invalid reserved bit RSV1 _(replaces 2310)_ - 2704: Invalid reserved bit RSV2 - 2705: Invalid reserved bit RSV3 - 2706: Invalid masked server message - 2707: Peculiar frame sizes _(part. replaces 2311)_ - 2708: Automatic PONG - 2709: No automatic PONG _(replaces 2312)_ - 2710: Unsolicited PONG - 2711: Empty PING/PONG/CLOSE - 2712: Max sized PING/PONG/CLOSE - 2713: Invalid oversized PING _(replaces 2307)_ - 2714: Invalid oversized PONG - 2715: Invalid oversized CLOSE - 2716: Invalid fragmented PING - 2717: Invalid fragmented PONG - 2718: Invalid fragmented CLOSE - 2719: Fragmented messages _(part. replaces 2311)_ - 2720: Fragmented messages with empty fragments - 2721: Fragmented messages with interleaved pong - 2722: Invalid fragmented message without initial frame - 2723: Invalid fragmented message without final frame - 2305: curl_ws_recv() loop reading three larger frames - This test involuntarily sent an invalid sequence of opcodes (0x01...,0x01...,0x81...) , but neither libcurl nor the test caught this! The correct sequence was tested in 2311 (0x01...,0x00...,0x80...). See below for 2311. - Validation of the opcode sequence was added to libcurl and is now tested in 2723. - Superseded by 2719 (fragmented message) and 2707 (large frames). - 2307: overlong PING payload - The tested PING payload length check was actually missing, but the test didn't catch this since it involuntarily sent an invalid opcode (0x19... instead of 0x89...) so that the expected error occurred, but for the wrong reason. - Superseded by 2713. - 2310: unknown reserved bit set in frame header - Superseded by 2703 and extended by 2704 and 2705. - 2311: curl_ws_recv() read fragmented message - Superseded by 2719 (fragmented message) and 2707 (large frames). - 2312: WebSockets no auto ping - Superseded by 2709. - No tests for `CURLOPT_WRITEFUNCTION`. - No tests for sending of invalid frames/fragments. Closes #17136
118 lines
5.7 KiB
Plaintext
118 lines
5.7 KiB
Plaintext
Guenter Knauf <lists@gknw.net> <gk@gknw.de>
|
|
Gisle Vanem <gvanem@yahoo.no> <gisle.vanem@gmail.com>
|
|
Gisle Vanem <gvanem@yahoo.no> <gvanem@broadpark.no>
|
|
Alessandro Ghedini <alessandro@ghedini.me> <alessandro@cloudflare.com>
|
|
Alessandro Ghedini <alessandro@ghedini.me> <al3xbio@gmail.com>
|
|
Björn Stenberg <bjorn@haxx.se>
|
|
Björn Stenberg <bjorn@haxx.se> <bjst@bjorn>
|
|
Viktor Szakats <commit@vsz.me> <commit@vszakats.net>
|
|
Viktor Szakats <commit@vsz.me> <vszakats@users.noreply.github.com>
|
|
Daniel Gustafsson <daniel@yesql.se> <dgustafsson@pivotal.io>
|
|
Daniel Gustafsson <daniel@yesql.se> <daniel@hobbit.se>
|
|
Linus Nielsen <linus@haxx.se>
|
|
Yamada Yasuharu <yasuharu.yamada@access-company.com>
|
|
Ulion <ulion2002@gmail.com>
|
|
Tim Rühsen <tim.ruehsen@gmx.de>
|
|
Steve Holme <steve_holme@hotmail.com> <steven.holme@cubic.com>
|
|
Claes Jakobsson <claes@surfar.nu> <claes@versed.se>
|
|
Sergei Nikulov <sergey.nikulov@gmail.com> <snikulov@users.noreply.github.com>
|
|
Patrick Monnerat <patrick@monnerat.net> <Patrick.Monnerat@datasphere.ch>
|
|
Patrick Monnerat <patrick@monnerat.net> <patrick.monnerat@dh.com>
|
|
Patrick Monnerat <patrick@monnerat.net> <pm@datasphere.ch>
|
|
Patrick Monnerat <patrick@monnerat.net> <monnerat@users.noreply.github.com>
|
|
Nick Zitzmann <nickzman@gmail.com> <nick@chronosnet.com>
|
|
Peter Wu <peter@lekensteyn.nl> <peter_at_lekensteyn.nl>
|
|
David Woodhouse <David.Woodhouse@intel.com> <dwmw2@infradead.org>
|
|
Marcel Raad <Marcel.Raad@teamviewer.com> <raad@teamviewer.com>
|
|
Marcel Raad <Marcel.Raad@teamviewer.com> <MarcelRaad@users.noreply.github.com>
|
|
Marcel Raad <Marcel.Raad@teamviewer.com> <marcelraad@users.sf.net>
|
|
Anthony Bryan <anthonybryan@gmail.com> <ant@localhost.localdomain>
|
|
Travis Burtrum <admin@moparisthebest.com>
|
|
Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
|
|
Richard Alcock <richard.alcock@gmail.com>
|
|
Richard Alcock <richard.alcock@gmail.com> <richard.alcock@mathworks.co.uk>
|
|
Jan Ehrhardt <github@ehrhardt.nl>
|
|
Florin Petriuc <petriuc.florin@gmail.com> <pfl@northq.com>
|
|
Pavel Pavlov <pavlov.pavel@gmail.com>
|
|
Jason Juang <jasjuang@gmail.com>
|
|
Carlo Teubner <carlo.teubner@gmail.com>
|
|
Joel Depooter <joel.depooter@safe.com>
|
|
Sebastian Mundry <mundry@outlook.com>
|
|
Rainer Canavan <rainer.canavan@sevenval.com> <canavan@users.noreply.github.com>
|
|
Dan Fandrich <dan@coneharvesters.com>
|
|
Henrik S. Gaßmann <henrik@gassmann.onl>
|
|
Jiří Malák <malak.jiri@gmail.com>
|
|
Nick Zitzmann <nickzman@gmail.com>
|
|
Kees Dekker <kees.dekker@infor.com>
|
|
Max Savenkov <max.savenkov@gmail.com>
|
|
Daniel Jelinski <daniel.jelinski@thomsonreuters.com> <30433125+djelinski@users.noreply.github.com>
|
|
Amit Katyal <amkatyal@cisco.com>
|
|
Giorgos Oikonomou <giorgos.n.oikonomou@gmail.com>
|
|
Evgeny Grin (Karlson2k) <k2k@narod.ru> <k2k@yandex.ru>
|
|
Evgeny Grin (Karlson2k) <k2k@narod.ru>
|
|
Peter Pih <railsnewbie257@gmail.com>
|
|
Anton Malov <malov.anton@gmail.com>
|
|
Marquis de Muesli <marquis.de.muesli@gmail.com>
|
|
Kyohei Kadota <lufia@lufia.org>
|
|
Lucas Pardue <lucaspardue.24.7@gmail.com> <lucas@cloudflare.com>
|
|
Massimiliano Fantuzzi <superfantuz@gmail.com>
|
|
Niall O'Reilly <Niall.oReilly@ucd.ie>
|
|
Mohammad Hasbini <mohammad.hasbini@gmail.com>
|
|
Andrew Ishchuk <andrew_ishchuk@office.targem.ru>
|
|
Nicolas Guillier <59726521+nicoguillier@users.noreply.github.com>
|
|
Julian Z <julianz@example.com> <jzinn@users.noreply.github.com>
|
|
Jessa Chandler <jessachandler@gmail.com>
|
|
Gökhan Şengün <gsengun@linux-5d7d.site> <gokhansengun@gmai.com>
|
|
Svyatoslav Mishyn <juef@openmailbox.org>
|
|
Douglas Steinwand <dzs-curl@dzs.fx.org>
|
|
James Fuller <jim@webcomposite.com>
|
|
Don J Olmstead <don.j.olmstead@gmail.com>
|
|
Nicolas Sterchele <sterchelen@gmail.com>
|
|
Sergey Raevskiy <ccik@inbox.ru>
|
|
SecuritySense on github <si@securitysense.co.uk>
|
|
Mipsters on github <tomaviv57@gmail.com>
|
|
Pavel Novikov <paul.skeptic@yandex.ru>
|
|
apique13 on github <apique@PC42.isdom.isoft.fr>
|
|
Daniel Hwang <danielleehwang@gmail.com>
|
|
Jon Rumsey <jrumsey@uk.ibm.com>
|
|
Tobias Nyholm <tobias.nyholm@gmail.com>
|
|
Timur Artikov <t.artikov@2gis.ru>
|
|
Michał Antoniak <47522782+MAntoniak@users.noreply.github.com>
|
|
Gleb Ivanovsky <gl.ivanovsky@gmail.com>
|
|
Max Dymond <max.dymond@microsoft.com> <max.dymond@metaswitch.com>
|
|
Max Dymond <max.dymond@microsoft.com> <cmeister2@gmail.com>
|
|
Abhinav Singh <theawless@gmail.com>
|
|
Malik Idrees Hasan Khan <77000356+MalikIdreesHasanKhan@users.noreply.github.com>
|
|
Yongkang Huang <hyk68691@hotmail.com>
|
|
Xiaoke Wang <xkernel.wang@foxmail.com>
|
|
Philip H <47042125+pheiduck@users.noreply.github.com>
|
|
neutric on github <5984479+neutric@users.noreply.github.com>
|
|
Jan-Piet Mens <jp@mens.de>
|
|
Henrik Holst <henrik.holst@millistream.com>
|
|
Christian Schmitz <support@monkeybreadsoftware.de>
|
|
Max Mehl <max.mehl@fsfe.org>
|
|
rzrymiak on github <106121613+rzrymiak@users.noreply.github.com>
|
|
Oliver Roberts <oliver@futaura.co.uk>
|
|
opensignature on github <antonio@piumarossa.it>
|
|
Cering on github <gfypm@qq.com>
|
|
a1346054 on github <36859588+a1346054@users.noreply.github.com>
|
|
zhanghu on xiaomi <zhanghu6@xiaomi.com>
|
|
Philip Heiduck <pheiduck@Philips-MBP.lan> <47042125+pheiduck@users.noreply.github.com>
|
|
bsergean on github <bsergean@gmail.com>
|
|
Stefan Eissing <stefan@eissing.org> <stefan.eissing@greenbytes.de>
|
|
Michael Musset <mickamusset@gmail.com>
|
|
Andy Alt <arch_stanton5995@protonmail.com>
|
|
Thomas1664 on github <46387399+Thomas1664@users.noreply.github.com>
|
|
dengjfzh on github <dengjfzh@gmail.com>
|
|
Brad Harder <brad.harder@gmail.com>
|
|
Derzsi Dániel <daniel@tohka.us>
|
|
Michael Osipov <michael.osipov@siemens.com> <1983-01-06@gmx.net>
|
|
Michael Osipov <michael.osipov@siemens.com> <michael-o@users.sf.net>
|
|
Christian Weisgerber <naddy@mips.inka.de> <curl-library@lists.haxx.se>
|
|
Moritz Buhl <git@moritzbuhl.de>
|
|
Aki Sakurai <75532970+AkiSakurai@users.noreply.github.com>
|
|
Sinkevich Artem <artsin666@gmail.com>
|
|
Andrew Kirillov <akirillo@uk.ibm.com>
|
|
Stephen Farrell <stephen.farrell@cs.tcd.ie>
|
|
Calvin Ruocco <calvin.ruocco@vector.com>
|