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.
Title: Security consideration: Sandboxing code execution in Omost canvas module
Description
Canvas.from_bot_responsecurrently usesexec()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
exec()evaluation.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.