AWorld icon indicating copy to clipboard operation
AWorld copied to clipboard

Unsafe pickle deserialization of Redis event-bus messages (RCE if the bus is writable)

Open VamsiSudhakaran1 opened this issue 4 months ago • 0 comments

Hi — thanks for AWorld. While reviewing the Redis event bus I hit a deserialization pattern worth a look.

Every Message is pickled and pushed to a Redis stream, then pickle.loads'd on consume:

aworld/events/redis_backend.py

async def publish(self, message: Message, **kwargs): data = {"data": pickle.dumps(message)} # line 38 msg_id = await self.client.xadd(name=name, id="*", fields=data)

async def consume(self, message: Message = None, **kwargs): ... data = pickle.loads(message_content.get(b"data")) # line 52 (also line 64 in consume_nowait) pickle.loads executes arbitrary code during deserialization. Here the payload is whatever sits on the Redis stream, so the security boundary is entirely the Redis instance. This is the default and only transport path — there's no safe-serializer opt-out.

The blast-radius question: is that Redis guaranteed single-tenant, network-isolated, and unreachable by any agent or tool that could be influenced by model output? In a multi-agent deployment the bus is often shared, and a single compromised/poisoned agent that can xadd to a task stream turns this into remote code execution on every consumer — after any input guardrail has already passed.

Suggested fix: use a non-executing serializer for transport (JSON/msgpack over Message.to_dict()), or if pickle is required, sign payloads (HMAC) and verify before loads. Even a documented "AWorld's Redis bus must be a fully-trusted, isolated instance" would help operators reason about it.

Found with release-gate, an open-source pre-deploy checker that flags model/agent data reaching dangerous sinks. Happy to be wrong if the bus is provably isolated in all deployments.

VamsiSudhakaran1 avatar Jul 05 '26 14:07 VamsiSudhakaran1