Advisory

GHSA-c2jg-5cp7-6wc7

Details, part 2 of 2. The advisory

Details

Mitigation

Users of Pipecat should take the following actions to eliminate or reduce the risk of this vulnerability:

  1. Avoid or replace unsafe deserialization: Ideally, do not use LivekitFrameSerializer at all given its use of unsafe pickle deserialization. Pipecat's maintainers have deprecated this class in favor of LiveKitTransport, which does not require explicit pickle usage. If users need to support LiveKit integration or any binary frame serialization, use safer alternatives:

* Use standardized formats like JSON for simple structured data, or binary formats like Protocol Buffers or MessagePack for more complex data structures. These formats do not execute code upon parsing.

* If users absolutely must use pickle (not recommended), implement a custom pickle.Unpickler with a restricted find_class() method. This can limit what classes and functions can be instantiated during unpickling (whitelisting only safe types), which can mitigate arbitrary code execution. However, even a restricted unpickler is risky and should be considered a last resort.

  1. Improve network security configuration: Limit who can reach the Pipecat service.

* Bind to localhost whenever possible. If the Pipecat server is intended for internal or single-machine use, use host="127.0.0.1" (or omit the host to default to localhost) instead of 0.0.0.0. This prevents external network access by default and significantly reduces exposure.

* Require authentication and authorization on the WebSocket connection. If the use case allows, enforce that clients must authenticate (using tokens, API keys, or other means) before accepting and processing frames. This won't fix the underlying code issue, but it can restrict who is able to send potentially malicious data.

In summary, the best mitigation is to stop using the vulnerable LivekitFrameSerializer altogether. If users require LiveKit functionality, upgrade to the latest Pipecat version and switch to the recommended LiveKitTransport or another secure method provided by the framework. Additionally, always follow secure coding practices: never trust client-supplied data, and avoid Python pickle (or similar unsafe deserialization) in network-facing components.

Sources & licences