Skip to content

Security: Potential RCE via Insecure Deserialization in ProcessExecutor and JsonPickleSerializer #664

@RinZ27

Description

@RinZ27

The use of jsonpickle.decode() in core components like ProcessExecutor and JsonPickleSerializer creates a significant Remote Code Execution (RCE) vulnerability. While this mechanism is currently used for Inter-Process Communication (IPC) to pass Node objects, the fact that Node structures can contain configuration data or user-provided inputs (e.g., prompts, external configs) makes it susceptible to malicious payload injection.

Technical Details

  • dynamiq/executors/pool.py: The deserialize_node method calls jsonpickle.decode(node_data) with a # nosec comment, explicitly bypassing security linters.
  • dynamiq/components/serializers.py: JsonPickleSerializer.loads performs the same insecure operation.

jsonpickle is inherently unsafe when handling data from untrusted or potentially manipulated sources. In a modern AI framework like Dynamiq, assuming all node configurations are trusted is a dangerous design choice.

Proposed Solution

Since Node and its related structures already inherit from Pydantic's BaseModel, I recommend transitioning from jsonpickle to Pydantic's native serialization. Using model_dump_json() and model_validate_json() ensures that data is handled as pure JSON, completely eliminating the risk of arbitrary code execution during deserialization.

This change would align the IPC mechanism with the rest of the project's architecture and significantly harden the system against RCE attacks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions