Skip to content

Security consideration: Sandboxing code execution in Omost canvas module #236

Description

@RinZ27

Title: Security consideration: Sandboxing code execution in Omost canvas module

Description
Canvas.from_bot_response currently uses exec() to execute code extracted directly from LLM responses. While this feature is powerful for canvas manipulation, it presents a significant security risk if the LLM is compromised or manipulated (e.g., via prompt injection) to return malicious code.

Proposed approach

  • Consider implementing a sandbox or restricted environment for extracted code execution.
  • Explore using a safer, restricted parser instead of direct exec() evaluation.
  • Add documentation warnings advising users to use only trusted models when utilizing this module.

Context
During a security audit of input safety for ComfyUI integrations, I identified this module as a high-priority area regarding architectural security and safe code execution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions