PipeWire SecurityContext appears to only restrict access via pipewire-pulse
#29
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The documentation seemed to imply that
SecurityContextprovided security similar to Waylandsecurity-context-v1, with a similar interface and plenty of references to Wayland documentation. Testing shows that while access throughpipewire-pulseis indeed restricted, protocol native is entirely unaffected and behaves as if noSecurityContextwas attached at all. It was, in fact, even possible to destroy theSecurityContextobject on the PipeWire server by targeting its global id in aRegistry::Destroymessage.If this is confirmed, and nothing can be done, Hakurei will need to expose only the
pipewire-pulsesocket via the host filesystem, analyse its behaviour to consider whether it is vulnerable to a confused deputy attack (protocol native has full access), and potentially also apply hardening via Landlock or similar to reduce access to the filesystem.Permissions are set up by code in an entirely separate repository, where read and execute permissions are blindly set on everything for clients with
PW_KEY_ACCESSset to"restricted":Registry::Destroyis implemented in src/pipewire/impl-core.c:This means that, with the exception of
PW_ID_CORE, the client is allowed to destroy any other object, even from behindSecurityContext.The PipeWire socket is no longer directly exposed due to fundamental and unfixable flaws in the
SecurityContextmachinery. The current implementation now maintains apipewire-pulsecontainer for each instance via the shim. A security update will be tagged after all automated tests pass and manual testing is completed.