redis/tests/support
Sergei Georgiev 37894faeea
Reject cluster bus PING extensions with missing null terminator (#15263)
## Summary

The cluster bus PING/PONG/MEET packet parser validated extension padding
and total length but never checked that string-carrying extensions are
properly null-terminated, allowing a crafted packet to trigger
out-of-bounds reads when the payload is later consumed as a C string.

1. **Null-termination check for hostname and human-nodename extensions
(`cluster_legacy.c`)**

Added a check inside the existing extension-validation loop in
`clusterProcessPacket`: for `CLUSTERMSG_EXT_TYPE_HOSTNAME` and
`CLUSTERMSG_EXT_TYPE_HUMAN_NODENAME` extension types, it verifies that
the data portion is non-empty (`datalen > 0`) and that the last byte is
`'\0'`. Packets failing this check are rejected with a warning log and
an early return, the same way other malformed-extension cases are
handled.

2. **Test (`hostnames.tcl`)**

A new test exercises the rejection path by constructing a raw
cluster-bus PING packet with a 32-byte hostname extension that contains
no `'\0'`, sending it directly to a node's bus port, and verifying the
packet is dropped (warning logged, hostname not updated in `CLUSTER
NODES`). Two helper procs (`build_cluster_bus_ping` and
`build_hostname_extension`) build the binary packet from scratch in Tcl,
allowing fine-grained control over extension contents without needing a
modified Redis sender.
2026-06-05 11:56:05 +03:00
..
aofmanifest.tcl AOF offset info (#13773) 2025-02-13 17:31:40 +08:00
benchmark.tcl Added URI support to redis-benchmark (cli and benchmark share the same uri-parsing methods) (#9314) 2021-09-14 19:45:06 +03:00
cli.tcl Improve bind and protected-mode config handling. (#9034) 2021-06-22 12:50:17 +03:00
cluster.tcl Support Tcl 9.0 in Redis test suite (#14787) 2026-02-28 14:07:25 +08:00
cluster_util.tcl Reject cluster bus PING extensions with missing null terminator (#15263) 2026-06-05 11:56:05 +03:00
redis.tcl Chore complete Tcl 9 support and fix regressions in test suite (#14845) 2026-03-06 13:27:56 +08:00
response_transformers.tcl Support Tcl 9.0 in Redis test suite (#14787) 2026-02-28 14:07:25 +08:00
server.tcl RED-184929: Auto-backups and restore test configuration (#14753) 2026-03-09 15:44:32 +08:00
test.tcl RED-184929: Auto-backups and restore test configuration (#14753) 2026-03-09 15:44:32 +08:00
tmpfile.tcl Initial implementation of a client-server parallel testing system for Redis in order to speedup execution of the test suite. 2011-07-10 23:25:48 +02:00
util.tcl Fix potential TCP deadlock in module datatype defrag test (#15274) 2026-06-02 09:37:29 +08:00