Skip to content

bug: obs-websocket: GetInputPropertiesListPropertyItems aborts OBS on a list item with no name or value (upstream #13905) #1266

Closed

Description

@rdoupe

Upstream bug, reported by sgaldeano in obsproject/obs-studio#13905 (September 2026, macOS 15, OBS 32.2.2, still open, no replies). GetInputPropertiesListPropertyItems for the display_uuid property of a macOS Screen Capture (screen_capture) input crashes OBS every time. xiaoshao9704 hit the same crash with the application property (macOS 26.5, OBS 32.1.2) and opened obsproject/obs-websocket#1355 with a null guard (open, no review). Still present in this fork: submodule at obs-rust/obs-websocket 0d663ee, and the macOS Screen Capture source here adds the same placeholder entries.

Location

  • plugins/obs-websocket/src/utils/Obs_ArrayHelper.cpp Utils::Obs::ArrayHelper::GetListPropertyItems(), lines 270 and 277:
    itemData["itemName"] = obs_property_list_item_name(property, i);
    ...
    itemData["itemValue"] = obs_property_list_item_string(property, i);
    The const char * goes straight into a json value. nlohmann::json builds a std::string from it, and a NULL pointer throws std::logic_error ("basic_string: construction from null is not valid"). Nothing catches it on the websocket thread, so OBS aborts.
  • libobs keeps list items as they were added (obs_property_list_add_string() stores a NULL name or value as NULL). plugins/mac-capture/mac-sck-common.m.h adds a placeholder at the top of the display list (obs_property_list_add_string(display_list, " ", NULL), line 109) and the application list (obs_property_list_add_string(application_list, " ", 0), line 207), so those two properties always hold such an item. Any plugin or script can add one too.

Class

Crash (uncaught exception, SIGABRT) from a plain websocket request.

How it is reached

CreateInput (or any existing input whose list property has an item with a NULL name or NULL string value), then GetInputPropertiesListPropertyItems with that propertyName. On macOS: a Screen Capture input and display_uuid or application. Upstream: obsproject/obs-studio#13905, obsproject/obs-websocket#1355.

Reproduced in the current release

v0.1.0-beta.20261014 AppImage on Linux, headless (private Xvfb, private D-Bus, fresh HOME, --multi). A Lua script source (loaded through the scene collection's Scripts tool entry) registers an input with three list properties: a string list whose first item is (" ", NULL) like the macOS placeholder, an int list whose first item has a NULL name, and a plain string list as a control. Websocket client: CreateInput, then GetInputPropertiesListPropertyItems:

Property Result
plain string list [{"itemName": "One", "itemValue": "one", "itemEnabled": true}]
first item has a NULL value connection lost; OBS aborted: terminate called after throwing an instance of 'std::logic_error', what(): basic_string: construction from null is not valid
first item has a NULL name the same abort

Current master (2d358b8, submodule 0d663ee), full build with frontend and obs-websocket, the same source as a C test module: the same two aborts, the control answers.

Proposed fix and failing test

Fix (in the obs-rust/obs-websocket fork, then a submodule bump here; port of obsproject/obs-websocket#1355 by xiaoshao9704): GetListPropertyItems() reports a NULL name or NULL string value as an empty string. That is also what the properties dialog stores when such an entry is picked (QByteArray(nullptr) gives ""), so a client can send the value back with SetInputSettings and get the same result as in the UI. Items with a name and value are reported as before.

RED test (cmocka, test_ws_list_property_items): compiles the plugin's ArrayHelper against libobs (no libobs startup, no display) and builds list properties with a NULL value and a NULL name. Today 2 of 3 cases fail (GetListPropertyItems threw 'basic_string: construction from null is not valid'); the control with ordinary items passes.

Activity

  1. rdoupe commented on Oct 17, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: this issue.

    Claiming: this issue.

    1. RED: test_ws_list_property_items compiles obs-websocket's ArrayHelper against libobs and builds list properties with an item that has a NULL value (like the macOS Screen Capture placeholder) and one with a NULL name: today both make the helper throw std::logic_error. Reproduced in 0.1.0-beta.20261014 and on master: OBS aborts on GetInputPropertiesListPropertyItems.
    2. GREEN: in the obs-rust/obs-websocket fork, a NULL name or value is reported as an empty string (port of requesthandler: Guard NULL list item names and string values obsproject/obs-websocket#1355); the submodule here moves to that fix.
      Fork PR today; the obs-studio PR follows once it merges.
  2. added
    claimed
    and removed
    claimed
    on Oct 17, 2026
  3. rdoupe commented on Oct 20, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming again (the claim lapsed while the fix waits for review): the fix is obs-rust/obs-websocket#18 (CI green, mergeable). The obs-studio side, the submodule bump and its regression test, is ready on a branch and opens as soon as #18 merges.

  4. added
    claimed
    on Oct 20, 2026
  5. removed
    claimed
    on Oct 22, 2026
  6. rdoupe commented on Oct 24, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #1266. The fix landed through the obs-websocket bump in #1996; I'm adding the regression test that shows it.

  7. added
    claimed
    on Oct 24, 2026
  8. rdoupe commented on Oct 24, 2026

    @rdoupe
    CollaboratorAuthor

    @sgaldeano you reported this in obsproject/obs-studio#13905: obs-websocket's GetInputPropertiesListPropertyItems aborted OBS on a list item with a NULL name or value, which the macOS Screen Capture display and application lists always contain. obs-rust now carries the fix from obsproject/obs-websocket#1355, and #2251 adds a regression test for it.

    The test builds a list property with a NULL item name and a NULL string value and passes it to the obs-websocket helper behind that request. Before the fix it threw, which aborts OBS on the websocket thread; with the fix, both come back as empty strings. That test ran headless on Linux, not on a Mac.

    It will be in the next obs-rust daily release after 0.1.0-beta.20261023: https://github.com/obs-rust/obs-studio/releases (Windows, macOS and Linux builds; on Arch it's obs-studio-rust-git in the AUR). obs-rust is an AI-assisted fork of OBS, based on current OBS master, with extra bug fixes like this one.

  9. added a commit that references this issue on Oct 24, 2026
    d14d493
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