Skip to content

[crash] libobs: scene item destroyed after its source on group/scene teardown (UAF, Windows) #649

Closed

Description

@zackees

Class: use after free (scene item outlives its source), libobs/obs-scene.c

Symptom: test_preview_audio_sources (PR #620, Rust Tier 2 windows) segfaults in teardown on Windows, where freed memory is poisoned (rcx = 0xfeeefeee...):

w32_pthreads!pthread_mutex_lock+0x8   (freed memory)
obs!getsignal_locked        signal.c:244
obs!signal_handler_disconnect signal.c:253
obs!obs_sceneitem_destroy   obs-scene.c:2398  (disconnect "rename" from item->source)
obs!remove_all_items        obs-scene.c:229

The log just before shows "source 'music grouped' destroyed" and "source 'hidden in group' destroyed", so the item's source was freed before the item.

Fixture: scenes MUSIC, GROUP (obs_scene_insert_group "Group" holding 'music grouped' and a hidden 'hidden in group'), NESTED (MUSIC), BOTH (GROUP). Teardown: obs_source_remove + obs_scene_release on BOTH, NESTED, GROUP, MUSIC, then obs_source_remove + obs_source_release on the 3 sources.

Linux does not show it (glibc does not poison freed memory); needs ASan/valgrind.

Plan: reproduce under ASan/valgrind, RED test test/cmocka/test_group_teardown_uaf.c, fix in libobs, GREEN.

Activity

  1. added
    claimed
    on Oct 13, 2026
  2. zackees commented on Oct 13, 2026

    @zackees
    MemberAuthor

    Claiming: this UAF. Plan: 1. RED cmocka test, 2. fix in libobs/obs-scene.c, 3. one PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions