[security] scene_manager/loader_xmt.c:750 Use-After-Free in xmt_find_node
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 40/100
Research direction
Reproduce with the linked .xmt sample under the ASan build, then read xmt_find_node at scene_manager/loader_xmt.c:750 together with its caller xmt_parse_route (:1221) and xmt_parse_element (:1739). Trace how nodes are registered and released during parsing, starting from gf_node_unregister in scenegraph/base_scenegraph.c:827, to see why a route can still resolve a node that was already freed. Done means the sample parses without an ASan heap-use-after-free report and node ownership during route resolution is clearly defined.
Written by the indexing model from the issue text.
Description
scene_manager/loader_xmt.c:750 Use-After-Free in xmt_find_node
Description:
While parsing a crafted XMT scene, xmt_parse_element (scene_manager/loader_xmt.c:1739) calls xmt_parse_route (scene_manager/loader_xmt.c:1221), which resolves a route endpoint through xmt_find_node (scene_manager/loader_xmt.c:750). A node referenced by the route has already been released earlier during parsing, so xmt_find_node reads memory that was freed. AddressSanitizer reports a heap-use-after-free at scene_manager/loader_xmt.c:750. The vanilla build is nondeterministic (the freed memory is sometimes still readable), which is expected for a use-after-free; the ASan report is the authoritative evidence.
To Reproduce
Steps to reproduce the behavior:
./MP4Box -add ./231_xmt_find_node_scene_manager_loader_xmt_c_750.xmt -new /dev/null
Output:
asan-build:
==403906==ERROR: AddressSanitizer: heap-use-after-free on address 0x7c47fefe7400 at pc 0x7fe8012231ef bp 0x7ffccde04b90 sp 0x7ffccde04b88
READ of size 8 at 0x7c47fefe7400 thread T0
#0 0x7fe8012231ee in xmt_find_node scene_manager/loader_xmt.c:750
#1 0x7fe80122358e in xmt_parse_route scene_manager/loader_xmt.c:1221
#2 0x7fe80122bcfd in xmt_parse_element scene_manager/loader_xmt.c:1739
#3 0x7fe801232ded in xmt_node_start scene_manager/loader_xmt.c:2984
#4 0x7fe80099e4dc in xml_sax_node_start utils/xml_parser.c:308
#5 0x7fe8009a32c3 in xml_sax_parse_attribute utils/xml_parser.c:357
#6 0x7fe8009a32c3 in xml_sax_parse utils/xml_parser.c:940
#7 0x7fe80099ef80 in gf_xml_sax_parse_intern utils/xml_parser.c:1110
#8 0x7fe8009a40b7 in gf_xml_sax_parse utils/xml_parser.c:1138
#9 0x7fe8009a4462 in xml_sax_read_file utils/xml_parser.c:1225
#10 0x7fe8009a4ffb in gf_xml_sax_parse_file utils/xml_parser.c:1354
#11 0x7fe801221644 in load_xmt_run scene_manager/loader_xmt.c:3712
#12 0x7fe8019375e0 in ctxload_process filters/load_bt_xmt.c:544
#13 0x7fe801676169 in gf_filter_process_task filter_core/filter.c:3257
#14 0x7fe801646f03 in gf_fs_thread_proc filter_core/filter_session.c:2420
#15 0x7fe80164bf7c in gf_fs_run filter_core/filter_session.c:2728
#16 0x7fe8010c64fb in gf_media_import media_tools/media_import.c:1639
#17 0x55b5684b3efd in import_file /run/media/user/8ed8205b-4114-4c2a-b2d0-e2ad6640262d/gpac/runtime/gpac_asan/applications/mp4box/fileimport.c:1733
#18 0x55b56846eb5c in do_add_cat /run/media/user/8ed8205b-4114-4c2a-b2d0-e2ad6640262d/gpac/runtime/gpac_asan/applications/mp4box/mp4box.c:4679
#19 0x55b56847123b in mp4box_main /run/media/user/8ed8205b-4114-4c2a-b2d0-e2ad6640262d/gpac/runtime/gpac_asan/applications/mp4box/mp4box.c:6447
#20 0x7fe800433fb9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:59
#21 0x7fe8004340d6 in __libc_start_main_impl ../csu/libc-start.c:360
#22 0x55b56844f0c0 in _start (/run/media/user/8ed8205b-4114-4c2a-b2d0-e2ad6640262d/gpac/runtime/gpac_asan/bin/gcc/MP4Box+0x4e0c0) (BuildId: d055c5484f27068a8903997f49222289a37b0af7)
0x7c47fefe7400 is located 0 bytes inside of 64-byte region [0x7c47fefe7400,0x7c47fefe7440)
freed by thread T0 here:
#0 0x7fe80272340f in free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:51
#1 0x7fe800a78a37 in gf_node_unregister scenegraph/base_scenegraph.c:827
previously allocated by thread T0 here:
#0 0x7fe80272435f in malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:67
#1 0x7fe800af1d08 in VisibilitySensor_Create scenegraph/mpeg4_nodes.c:15769
#2 0x7fe800af1d08 in gf_sg_mpeg4_node_new scenegraph/mpeg4_nodes.c:36902
SUMMARY: AddressSanitizer: heap-use-after-free scene_manager/loader_xmt.c:750 in xmt_find_node
Environment
OS: tested at 7.1.5+kali-amd64 x86_64 GNU/Linux ;
Compiler version: GCC 15.3.0-2 ;
CPU type: x86_64 ;
MP4Box - GPAC commit hash 425ef34eecf4583cf1163baca1df772e91a0ce35 ;
MP4Box - GPAC version 26.08-DEV-rev397-g425ef34ee-master ;
Additional context
link to the sample (github-url):
231_xmt_find_node_scene_manager_loader_xmt_c_750.xmt
Screenshots


- Dominant language
- C
- Stars
- 3.3k
- Forks
- 601
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 22
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from gpac/gpac
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 2 days
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ClassiCube/ClassiCube#1623 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
[BUG] Regression in 9.2.0: `socket.c: error: storage size of 'info' isn't known`Possibly taken @barracuda156 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
valkey-io/valkey#5551 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day