curl/tests/server
Raymond Steen 2bb5c9b555
mqtt: validate PINGRESP and DISCONNECT have remaining_length == 0
Per MQTT 3.1.1 sections 3.13.1 and 3.14.1, PINGRESP and DISCONNECT fixed
headers must have remaining_length set to zero. The previous code
dispatched to mqtt->nextstate based on the queued state alone without
validating remaining_length for these no-payload packet types, allowing
a malicious broker to send a PINGRESP with non-zero remaining_length
whose trailing bytes would be interpreted as the payload of whatever
message type was queued (CONNACK, SUBACK, etc.).

The exploitation path turned out to be narrow — curl sends data to the
server the user chose to talk to — but the spec violation and the
resulting protocol-state error are real. Reject the malformed packets
with CURLE_WEIRD_SERVER_REPLY before state dispatch.

Reported-by: Raymond Steen <raymond@vortiqxconsilium.com>
Found by VORTIQ-X VXF Framework
Bug: https://hackerone.com/reports/3702718

Signed-off-by: Raymond Steen <raymond@vortiqxconsilium.com>
Closes #21465
2026-04-30 14:14:44 +02:00
..
.checksrc build: tidy up and dedupe strdup functions 2026-02-03 14:02:30 +01:00
.gitignore tests: always make bundles, adapt build and tests 2025-06-14 21:08:23 +02:00
CMakeLists.txt cmake: rename testbins target to tt, restore internal option 2026-03-01 00:24:47 +01:00
dnsd.c dnsd: implement HTTPS-RR with alpn pref and no-default-alpn 2026-04-16 22:53:20 +02:00
first.c build: use more const 2026-02-02 12:32:49 +01:00
first.h build: include curlx headers directly in src and tests 2026-03-16 12:05:39 +01:00
getpart.c tidy-up: miscellaneous 2026-03-09 11:35:19 +01:00
Makefile.am autotools: limit checksrc target to ignore non-repo test sources 2026-03-12 01:45:24 +01:00
Makefile.inc tests/server: drop unused curlx/version_win32.c 2026-03-08 18:17:11 +01:00
mqttd.c mqtt: validate PINGRESP and DISCONNECT have remaining_length == 0 2026-04-30 14:14:44 +02:00
resolve.c build: use more const 2026-02-02 12:32:49 +01:00
rtspd.c tidy-up: miscellaneous 2026-03-09 11:35:19 +01:00
sockfilt.c build: adjust/add casts to fix -Wformat-signedness 2026-04-16 11:38:14 +02:00
socksd.c tidy-up: miscellaneous 2026-02-25 14:44:56 +01:00
sws.c build: fix -Wformat-signedness by adjusting printf masks 2026-04-16 10:32:50 +02:00
tftpd.c curlx: add local snprintf() helper that always nul-terminates (Windows) 2026-03-02 21:30:36 +01:00
util.c build: fix -Wformat-signedness by adjusting printf masks 2026-04-16 10:32:50 +02:00