spawn/modal/lib
A dcf41c63ea
fix: Prevent Python injection in Modal provider via env vars (#127)
MODAL_SANDBOX_ID and sandbox name were interpolated directly into
Python code strings, allowing potential code injection. Now all
user-controlled values are passed via environment variables and
read with os.environ in Python.

Changes:
- create_server: pass name/image via _MODAL_NAME/_MODAL_IMAGE env vars,
  use getattr() for image lookup, add sandbox name validation
- run_server: pass sandbox ID and command via env vars
- interactive_session: pass sandbox ID and command via env vars
- destroy_server: pass sandbox ID via env var
- Add validate_sandbox_id() to enforce sb-<alphanumeric> format
- upload_file: remove printf '%q' escaping (base64 is safe)

Agent: security-auditor

Co-authored-by: A <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-09 20:22:08 -08:00
..
common.sh fix: Prevent Python injection in Modal provider via env vars (#127) 2026-02-09 20:22:08 -08:00