molecule-core/workspace
Molecule AI Infra-SRE a205099652 fix(security): OFFSEC-003 — boundary-marker escape + shared sanitizer
Root cause (from infra-lead PR#7 review id=724):
Sanitization in PR#7 wrapped peer text in [A2A_RESULT_FROM_PEER]
markers, but the markers themselves were not escaped — a malicious
peer could inject "[/A2A_RESULT_FROM_PEER]" to close the trust
boundary early, making subsequent text appear inside the trusted zone.

Fix:
- Create workspace/_sanitize_a2a.py (leaf module, no circular import
  risk) with shared sanitize_a2a_result() + _escape_boundary_markers()
- _escape_boundary_markers() escapes boundary open/close markers in the
  raw peer text before wrapping (primary security control)
- Defense-in-depth: also escapes SYSTEM/OVERRIDE/INSTRUCTIONS/IGNORE
  ALL/YOU ARE NOW patterns (secondary, per PR#7 design intent)
- Update a2a_tools_delegation.py: import from _sanitize_a2a; wrap
  tool_delegate_task return and tool_check_task_status response_preview
- Add 15 tests covering boundary escape, injection patterns, integration
  shapes (workspace/tests/test_a2a_sanitization.py)

Follow-up (non-blocking, noted in PR#7 infra-lead review):
- Deduplicate if a2a_tools.py also wraps (currently handled in
  delegation module only — callers get sanitized output regardless)
- tool_check_task_status: consider sanitizing 'summary' field too

Closes: molecule-ai/molecule-ai-workspace-runtime#7 (wrong-repo PR
that this supersedes)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 02:16:09 +00:00
..
adapters
builtin_tools fix(a2a): handle string error in a2a_tools.py + remove dead staging trigger 2026-05-10 09:52:36 +00:00
lib
molecule_audit
platform_tools
plugins_registry
policies
scripts feat(workspace): add static .github-token fallback to git credential helper 2026-05-10 02:17:22 +00:00
skill_loader
tests fix(security): OFFSEC-003 — boundary-marker escape + shared sanitizer 2026-05-11 02:16:09 +00:00
_sanitize_a2a.py fix(security): OFFSEC-003 — boundary-marker escape + shared sanitizer 2026-05-11 02:16:09 +00:00
.coveragerc
a2a_cli.py
a2a_client.py fix(a2a): SSOT response parser — handle poll-mode queued envelope (#2967) 2026-05-05 17:21:28 -07:00
a2a_executor.py
a2a_mcp_server.py fix(onboarding): address Claude Code MCP onboarding friction (#2934) 2026-05-05 14:19:09 -07:00
a2a_response.py fix(a2a): handle push-mode queue envelope in response parser 2026-05-10 09:28:51 +00:00
a2a_tools_delegation.py fix(security): OFFSEC-003 — boundary-marker escape + shared sanitizer 2026-05-11 02:16:09 +00:00
a2a_tools_inbox.py refactor(workspace): extract inbox tools from a2a_tools.py (RFC #2873 iter 4e) 2026-05-05 14:28:58 -07:00
a2a_tools_memory.py refactor(workspace): extract memory tools from a2a_tools.py to a2a_tools_memory.py (RFC #2873 iter 4c) 2026-05-05 09:50:39 -07:00
a2a_tools_messaging.py refactor(workspace): extract messaging tools from a2a_tools.py to a2a_tools_messaging.py (RFC #2873 iter 4d) 2026-05-05 09:50:47 -07:00
a2a_tools_rbac.py refactor(workspace): extract RBAC helpers from a2a_tools.py to a2a_tools_rbac.py (RFC #2873 iter 4a) 2026-05-05 04:43:16 -07:00
a2a_tools.py refactor(workspace): extract inbox tools from a2a_tools.py (RFC #2873 iter 4e) 2026-05-05 14:28:58 -07:00
adapter_base.py
agent.py
agents_md.py
boot_routes.py
build-all.sh docs(workspace-runtime): migrate github.com refs at source so mirror inherits Gitea links (internal#41) 2026-05-07 00:48:04 -07:00
card_helpers.py
config.py fix(runtime): MODEL_PROVIDER env is misnamed — accept MODEL/MOLECULE_MODEL, deprecate the legacy name 2026-05-10 02:38:14 -07:00
configs_dir.py
consolidation.py
coordinator.py
Dockerfile ci(docker): pin base image digests in all Dockerfiles 2026-05-09 23:56:39 +00:00
entrypoint.sh fix(workspace): set git user.name/email from $GITEA_USER at boot 2026-05-09 12:52:17 -07:00
event_log.py
events.py
executor_helpers.py
heartbeat.py
inbox_uploads.py fix(inbox-uploads): cancel BatchFetcher futures on wait_all timeout 2026-05-05 12:34:41 -07:00
inbox.py fix(inbox): drop unused batch_fetcher = None after end-of-batch drain 2026-05-05 11:56:54 -07:00
initial_prompt.py
internal_chat_uploads.py
internal_file_read.py
main.py tech-debt: rename molecule-monorepo-net -> molecule-core-net 2026-05-09 20:51:48 +00:00
mcp_cli.py feat(mcp): add molecule-mcp doctor onboarding diagnostic 2026-05-05 15:44:36 -07:00
mcp_doctor.py fix(mcp-doctor): heartbeat (idempotent) instead of register (UPSERT) 2026-05-05 16:11:08 -07:00
mcp_heartbeat.py refactor(workspace): split mcp_cli.py (626 LOC) into focused modules (RFC #2873 iter 3) 2026-05-05 04:33:06 -07:00
mcp_inbox_pollers.py refactor(workspace): split mcp_cli.py (626 LOC) into focused modules (RFC #2873 iter 3) 2026-05-05 04:33:06 -07:00
mcp_workspace_resolver.py mcp: surface specific TOKEN_FILE errors + link follow-ups (#2934) 2026-05-05 15:07:15 -07:00
molecule_ai_status.py
not_configured_handler.py
platform_auth.py
platform_inbound_auth.py
plugins.py
preflight.py
prompt.py
pytest.ini
rebuild-runtime-images.sh
requirements.txt
runtime_wedge.py
secret_redactor.py
shared_runtime.py
smoke_mode.py
transcript_auth.py
watcher.py