opnsense-src/sbin/dhclient
Dag-Erling Smørgrav 1ca7f34a07 dhclient: Improve server and filename validation
* Don't iterate over each string three times; once is enough.

* Reject control characters (anything below space) in addition to the
  double quote and backslash.

* If an unsafe character is encountered, discard the string instead of
  rejecting the entire lease.

* If backslashes are encountered in the file name option, convert them
  to forward slashes instead of rejecting the option.

* Tweak the warning messages a bit.  Looking through the rest of the
  code, it seems to me that notes generally end with a period while
  warnings generally don't.

Approved by:	so
Security:	FreeBSD-EN-26:11.dhclient
Fixes:		8008e4b88daf ("dhclient: Check for unexpected characters in some DHCP server options")
PR:		294886
MFC after:	1 week
Reviewed by:	brooks, markj
Differential Revision:	https://reviews.freebsd.org/D56740

(cherry picked from commit 873a195ba63575e46686cfd6ea9670a0ca340fa0)
(cherry picked from commit 2f9478ad42c442c49a7eff60227148bf2b90b48c)
2026-05-21 07:32:00 +02:00
..
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
alloc.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
bpf.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
clparse.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
conflex.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
convert.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
dhclient-script Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
dhclient-script.8 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
dhclient.8 dhclient: Update dhclient man page for n flag 2024-08-19 21:57:09 -07:00
dhclient.c dhclient: Improve server and filename validation 2026-05-21 07:32:00 +02:00
dhclient.conf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
dhclient.conf.5 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
dhclient.leases.5 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
dhcp-options.5 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
dhcp.h dhclient: Ignore vendor-identifying DHCP options defined in RFC 3925 2024-10-12 14:11:04 +02:00
dhcpd.h dhclient: Keep two clocks 2025-04-22 21:50:31 -07:00
dhctoken.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
dispatch.c dhclient: Keep two clocks 2025-04-22 21:50:31 -07:00
errwarn.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
hash.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
inet.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend.options Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
options.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
packet.c dhclient: improve UDP checksum handling 2025-10-23 08:11:21 +02:00
parse.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
privsep.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
privsep.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
tables.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
tree.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
tree.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00