提交 #846839: GPAC v0.9.0 - v2.5-DEV Double Free信息

标题GPAC v0.9.0 - v2.5-DEV Double Free
描述 A double-free vulnerability exists in GPAC MP4Box in the ISOBMFF NALU sample rewrite logic. The issue affects gf_isom_nalu_sample_rewrite() in src/isomedia/avc_ext.c when processing crafted AVC/HEVC samples through MP4Box -cat. During NALU rewriting, mdia->nalu_out_bs may be reassigned to directly reference sample->data. On normal paths the buffer is detached with gf_bs_get_content_no_truncate(), but when an invalid NAL size is encountered, the function returns through the goto exit error path without detaching mdia->nalu_out_bs->original from sample->data. This leaves nalu_out_bs->original pointing to a buffer that is later freed as part of sample cleanup. When the media box is destroyed, mdia_box_del() calls gf_bs_del() on nalu_out_bs. Since the bitstream is in GF_BITSTREAM_WRITE_DYN mode and original is still non-NULL, gf_bs_del() frees the same buffer again, resulting in a double-free. The vulnerability can be triggered by a crafted media file using: ./MP4Box -cat <crafted_file> white.mp4 -out /dev/null Successful exploitation can cause process crash and denial of service, and may lead to memory corruption depending on allocator behavior. The issue is fixed by ensuring the error path detaches the reused bitstream buffer before returning.
来源⚠️ https://github.com/gpac/gpac/issues/3403
用户
 noki (UID 98507)
提交2026-06-03 14時28分 (4 月前)
管理2026-07-04 07時16分 (1 month later)
状态已接受
VulDB条目376292 [GPAC 直到 2.5-DEV MP4Box src/isomedia/avc_ext.c gf_isom_nalu_sample_rewrite nalu_out_bs 内存损坏]
积分20

Do you know our Splunk app?

Download it now for free!