PROBLEM

The concat and concatf protocols allowed nested file and subfile
protocols automatically.

An attacker who controlled an input URL could therefore provide a URL
such as:

concat:file:/etc/passwd|file:/etc/hostname

When FFmpeg processed that input, it could read local files that the
calling service did not intend to expose.

FIX

The default protocol whitelists for concat and concatf now allow only
their own concat protocols.

Local file access is still possible when explicitly requested through
-protocol_whitelist, but it is no longer enabled automatically for
untrusted input.

Signed-off-by: Mohammed Mustafa <[email protected]>
---
 libavformat/concat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/concat.c b/libavformat/concat.c
index f15cee2ff4..ea7394fff8 100644
--- a/libavformat/concat.c
+++ b/libavformat/concat.c
@@ -212,7 +212,7 @@ const URLProtocol ff_concat_protocol = {
     .url_seek       = concat_seek,
     .url_close      = concat_close,
     .priv_data_size = sizeof(struct concat_data),
-    .default_whitelist = "concat,file,subfile",
+    .default_whitelist = "concat",
 };
 #endif

@@ -328,6 +328,6 @@ const URLProtocol ff_concatf_protocol = {
     .url_seek       = concat_seek,
     .url_close      = concat_close,
     .priv_data_size = sizeof(struct concat_data),
-    .default_whitelist = "concatf,concat,file,subfile",
+    .default_whitelist = "concatf,concat",
 };
 #endif
-- 
2.53.0
_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to