molecule-ai-workspace-runtime/molecule_runtime/builtin_tools
Molecule AI Infra-SRE 32a7880f4f test+fix(builtin_tools/validation): add test coverage + fix ".." bypass in regex
Tests: 37 new test cases in tests/test_validation.py covering:
- Valid ID patterns (6): normal IDs, underscores, dots, max-length (256)
- Empty/missing (1): raises with "empty" in message
- Invalid chars (10): / \ .. # ? & whitespace
- Caching (2): result is cached; raises on repeated bad calls
- Error type (1): WorkspaceIdValidationError is a ValueError subclass

Fix: regex now uses negative lookahead `(?!.*\.\.)` to reject ".." anywhere
in the string (not just at the start). The old pattern `^[A-Za-z0-9_\-.]{1,256}$`
matched ".." literally because two dots ARE in the allowed character class.
Also adds test cases for embedded ".." (ws..example, ws../etc).

Fixes: the ".." bypass was a gap in the original CWE-20 fix.
2026-04-21 00:55:08 +00:00
..
__init__.py feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
a2a_tools.py fix(builtin_tools): validate WORKSPACE_ID before URL construction 2026-04-21 00:55:08 +00:00
approval.py fix(builtin_tools): validate WORKSPACE_ID before URL construction 2026-04-21 00:55:08 +00:00
audit.py fix(builtin_tools/audit): fail-secure RBAC — read-only default when config unavailable 2026-04-20 22:47:38 +00:00
awareness_client.py feat(builtin_tools/memory): add optional namespace param to commit_memory and search_memory 2026-04-20 23:12:32 +00:00
compliance.py feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
delegation.py fix(builtin_tools): validate WORKSPACE_ID before URL construction 2026-04-21 00:55:08 +00:00
governance.py feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
hitl.py feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
medo.py feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
memory.py fix(builtin_tools): validate WORKSPACE_ID before URL construction 2026-04-21 00:55:08 +00:00
sandbox.py fix(cli_executor + sandbox): CWE-78 auth helper + subprocess warning 2026-04-20 23:05:57 +00:00
security_scan.py fix: add auth headers to skill promotion logs and improve pip-audit severity parsing 2026-04-20 05:03:22 +00:00
telemetry.py feat: initial release of molecule-ai-workspace-runtime 0.1.0 2026-04-16 04:26:06 -07:00
temporal_workflow.py fix: switch top-level from adapters import to absolute imports (#1) 2026-04-16 07:53:03 -07:00
validation.py test+fix(builtin_tools/validation): add test coverage + fix ".." bypass in regex 2026-04-21 00:55:08 +00:00