From cb112ece1c02e76529fed162487fa627ad4fa3a7 Mon Sep 17 00:00:00 2001 From: Franciszek Kalinowski Date: Tue, 19 May 2026 09:43:54 +0200 Subject: [PATCH] avformat/icecast: reject CR/LF in metadata header values Reported by Franciszek Kalinowski (isec.pl / striga.ai) and Bartosz Smigielski. (cherry picked from commit 99e1ecca36455689c0c417a02ca36cd5b6e2346d) Signed-off-by: Michael Niedermayer --- libavformat/icecast.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavformat/icecast.c b/libavformat/icecast.c index 3146d7f384..323d330e42 100644 --- a/libavformat/icecast.c +++ b/libavformat/icecast.c @@ -70,8 +70,14 @@ static const AVOption options[] = { static void cat_header(AVBPrint *bp, const char key[], const char value[]) { - if (NOT_EMPTY(value)) + if (NOT_EMPTY(value)) { + if (strpbrk(value, "\r\n")) { + av_log(NULL, AV_LOG_ERROR, + "Refusing to send '%s' header: value contains CR/LF\n", key); + return; + } av_bprintf(bp, "%s: %s\r\n", key, value); + } } static int icecast_close(URLContext *h)