opnsense-src/sys/netinet/libalias
Dag-Erling Smørgrav f7230ff357 libalias: Fix buffer overflow in RTSP aliasing
In alias_rtsp_out(), we construct a new packet in a fixed-length buffer
before copying it back into the original buffer.  We never checked if
the data we were writing to this temporary buffer fit in it, nor if the
result fit in the original buffer.

* Use a dynamically sized allocated buffer instead of a fixed-length
  stack buffer.

* Check for overflow before appending to our temporary buffer.

* Check for overflow before copying the data back to the packet buffer.

* While here, use size_t for sizes and bool for booleans.

Approved by:	so
Security:	FreeBSD-SA-26:41.libalias
Security:	CVE-2026-49420
MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D57753
2026-07-06 10:29:28 +02:00
..
alias.c libalias: Handle GetNewPort() errors properly 2025-04-18 15:11:51 +00:00
alias.h libalias: Add support for EIM NAT 2024-12-05 16:19:13 +00:00
alias_db.c machine/stdarg.h -> sys/stdarg.h 2025-06-11 17:39:02 +01:00
alias_db.h libalias: Add support for EIM NAT 2024-12-05 16:19:13 +00:00
alias_dummy.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
alias_ftp.c tcp: extend the use of the th_flags accessor function 2024-11-29 09:48:23 +01:00
alias_irc.c libalias: Handle GetNewPort() errors properly 2025-04-18 15:11:51 +00:00
alias_local.h libalias: Handle GetNewPort() errors properly 2025-04-18 15:11:51 +00:00
alias_mod.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
alias_mod.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
alias_nbt.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
alias_pptp.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
alias_proxy.c tcp: extend the use of the th_flags accessor function 2024-11-29 09:48:23 +01:00
alias_sctp.c machine/stdarg.h -> sys/stdarg.h 2025-06-11 17:39:02 +01:00
alias_sctp.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
alias_skinny.c libalias: Handle GetNewPort() errors properly 2025-04-18 15:11:51 +00:00
alias_smedia.c libalias: Fix buffer overflow in RTSP aliasing 2026-07-06 10:29:28 +02:00
alias_util.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
HISTORY sys: Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:17 -06:00
libalias.3 man: Remove references to classful networks 2025-02-04 22:27:21 +01:00