pipewire/src/modules/module-sendspin
Wim Taymans 7465199fff security: replace unsafe atoi() with validated parsing in websocket
Input Validation: High

The WebSocket HTTP reply parser used atoi() to parse the Content-Length
header from network data. atoi() does not detect overflow or invalid
input, and its int return value was assigned to a size_t, meaning a
negative value from a malicious server would silently convert to a very
large unsigned value, potentially causing excessive memory allocation.

Replaced with spa_atou32() which validates the entire string is a valid
number and fits in uint32_t, plus an explicit upper bound (16 MB) on
content length to prevent resource exhaustion.

Similarly, pw_websocket_listen() used atoi() to parse the port number
into a uint16_t without validation. Replaced with spa_atou32() and a
range check against 65535.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-28 12:14:36 +02:00
..
regress.h sendspin: add sendspin sender and receiver 2026-02-26 12:17:17 +01:00
sendspin.h zeroconf: sanitize the properties 2026-02-27 17:31:42 +01:00
teeny-sha1.c sendspin: add sendspin sender and receiver 2026-02-26 12:17:17 +01:00
websocket.c security: replace unsafe atoi() with validated parsing in websocket 2026-04-28 12:14:36 +02:00
websocket.h sendspin: add sendspin sender and receiver 2026-02-26 12:17:17 +01:00