Welcome! Log In Create A New Profile

Advanced

[nginx] Mp4: fixed reading 64-bit atoms.

Maxim Dounin
November 06, 2018 10:24AM
details: http://hg.nginx.org/nginx/rev/e5069816039b
branches:
changeset: 7376:e5069816039b
user: Roman Arutyunyan <arut@nginx.com>
date: Tue Nov 06 16:29:18 2018 +0300
description:
Mp4: fixed reading 64-bit atoms.

Previously there was no validation for the size of a 64-bit atom
in an mp4 file. This could lead to a CPU hog when the size is 0,
or various other problems due to integer underflow when calculating
atom data size, including segmentation fault or worker process
memory disclosure.

diffstat:

src/http/modules/ngx_http_mp4_module.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diffs (17 lines):

diff --git a/src/http/modules/ngx_http_mp4_module.c b/src/http/modules/ngx_http_mp4_module.c
--- a/src/http/modules/ngx_http_mp4_module.c
+++ b/src/http/modules/ngx_http_mp4_module.c
@@ -942,6 +942,13 @@ ngx_http_mp4_read_atom(ngx_http_mp4_file
atom_size = ngx_mp4_get_64value(atom_header + 8);
atom_header_size = sizeof(ngx_mp4_atom_header64_t);

+ if (atom_size < sizeof(ngx_mp4_atom_header64_t)) {
+ ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
+ "\"%s\" mp4 atom is too small:%uL",
+ mp4->file.name.data, atom_size);
+ return NGX_ERROR;
+ }
+
} else {
ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
"\"%s\" mp4 atom is too small:%uL",
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Mp4: fixed reading 64-bit atoms.

Maxim Dounin 268 November 06, 2018 10:24AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 157
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready