Files
dnsmasq/src
Dominik ca509cb611 dhcp-common: fix OOB reads in DHCPv6 option_string() decoders
Two decoders in option_string() read beyond the end of the supplied
option-value buffer when a malformed DHCPv6 option is received:

1. OT_RFC1035_NAME: after advancing i past the last label (i = l),
   val[i] was read at line 885 to decide whether to append a '.'.
   If the label ends exactly at opt_len, i == opt_len and val[i]
   is one byte past the option data.  Fixed by guarding with
   i < opt_len before the read.

2. OT_CSTRING: the loop opened with while(1) and called GETSHORT
   (a 2-byte read) before checking that two bytes remained, so a
   1- or 0-byte option value caused an immediate 1-byte OOB read.
   Additionally, if the length field exceeded the remaining option
   data the inner body-copy loop read past the end.  Fixed by
   changing the loop condition to while(i+2 <= opt_len) and adding
   a check that the body fits before copying.

Both reads land inside the received packet buffer (no crash), but
they allow a DHCPv6 client to cause dnsmasq to read unrelated packet
bytes and emit them in syslog output.

Security: OOB reads of up to option-length bytes from a
network-supplied DHCPv6 packet; reachable only with --log-dhcp
enabled; no memory corruption, crash, or sensitive data disclosure
beyond adjacent packet bytes.

Signed-off-by: Dominik <dl6er@dl6er.de>
2026-03-30 18:09:43 +01:00
..
2025-02-08 22:58:42 +00:00
2025-01-23 17:08:39 +00:00
2026-03-01 12:19:11 +00:00
2025-01-23 17:08:39 +00:00
2025-08-20 12:36:03 +01:00
2025-07-27 15:27:40 +01:00
2026-03-15 16:03:29 +00:00
2025-01-23 17:08:39 +00:00
2025-01-23 17:08:39 +00:00
2026-02-01 15:44:13 +00:00
2025-01-23 17:08:39 +00:00
2025-06-20 15:48:47 +01:00
2025-05-14 22:35:51 +01:00
2025-01-23 17:08:39 +00:00
2025-01-23 17:08:39 +00:00
2025-01-23 17:08:39 +00:00
2025-01-23 17:08:39 +00:00
2025-03-29 21:41:40 +00:00
2025-01-23 17:08:39 +00:00
2025-03-29 21:41:40 +00:00
2026-02-03 22:33:32 +00:00
2025-03-29 21:41:40 +00:00
2025-06-20 15:48:47 +01:00
2025-09-01 22:35:02 +01:00