molecule-ai-workspace-runtime/molecule_runtime
molecule-ai[bot] 30d96b4e4e
fix(platform_auth): validate WORKSPACE_ID at import time (issue #14, CWE-20) (#29)
WORKSPACE_ID was read via os.environ.get("WORKSPACE_ID", "") in multiple
builtin_tools modules and used directly in platform API URLs and X-Workspace-ID
headers without validation. A crafted ID containing /, .., or # could cause
URL path injection.

Fix: validate_workspace_id() in platform_auth.py now validates the ID format
at module import time using a regex that permits only lowercase alphanumerics
and hyphens (matching UUIDs and org-generated IDs). The validated value is
exposed as a module-level WORKSPACE_ID constant. builtin_tools/approval.py
and builtin_tools/delegation.py now import from platform_auth instead of
reading os.environ directly.

Failing input raises ValueError with a clear message — workspace fails fast
at startup rather than silently accepting malformed IDs in requests.

Add 15 regression tests (45/45 passing total).

Co-authored-by: Molecule AI Infra-Runtime-BE <infra-runtime-be@agents.moleculesai.app>
Co-authored-by: Infra-Runtime-BE <infra-runtime-be@molecule.ai>
2026-04-21 00:04:54 +00:00
..
adapters fix(adapter-loader): fall back to any BaseAdapter subclass 2026-04-20 16:59:12 -07:00
builtin_tools fix(platform_auth): validate WORKSPACE_ID at import time (issue #14, CWE-20) (#29) 2026-04-21 00:04:54 +00:00
plugins_registry fix(plugins_registry/builtins): strip API keys from plugin setup.sh env 2026-04-20 22:52:13 +00:00
policies feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
skill_loader feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
__init__.py feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
a2a_cli.py feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
a2a_client.py fix: MCP server path resolution + absolute imports (2nd half of #507) 2026-04-16 13:28:57 -07:00
a2a_executor.py fix: switch top-level from adapters import to absolute imports (#1) 2026-04-16 07:53:03 -07:00
a2a_mcp_server.py fix(builtin_tools/audit): fail-secure RBAC — read-only default when config unavailable 2026-04-20 22:47:38 +00:00
a2a_tools.py fix: MCP server path resolution + absolute imports (2nd half of #507) 2026-04-16 13:28:57 -07:00
agent.py feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
claude_sdk_executor.py fix: gate session resume on file existence (closes #488) 2026-04-16 11:12:03 -07:00
cli_executor.py fix(cli_executor + sandbox): CWE-78 auth helper + subprocess warning 2026-04-20 23:05:57 +00:00
config.py feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
consolidation.py fix: MCP server path resolution + absolute imports (2nd half of #507) 2026-04-16 13:28:57 -07:00
coordinator.py fix: switch top-level from adapters import to absolute imports (#1) 2026-04-16 07:53:03 -07:00
events.py feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
executor_helpers.py fix: MCP server path resolution + absolute imports (2nd half of #507) 2026-04-16 13:28:57 -07:00
heartbeat.py fix: MCP server path resolution + absolute imports (2nd half of #507) 2026-04-16 13:28:57 -07:00
initial_prompt.py feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
main.py fix(builtin_tools/audit): fail-secure RBAC — read-only default when config unavailable 2026-04-20 22:47:38 +00:00
molecule_ai_status.py feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
platform_auth.py fix(platform_auth): validate WORKSPACE_ID at import time (issue #14, CWE-20) (#29) 2026-04-21 00:04:54 +00:00
plugins.py feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
preflight.py fix: gate session resume on file existence (closes #488) 2026-04-16 11:12:03 -07:00
prompt.py fix: switch top-level from adapters import to absolute imports (#1) 2026-04-16 07:53:03 -07:00
transcript_auth.py feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
watcher.py feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00