[security] OFFSEC-003: staging tool_check_task_status still missing sanitization (follow-up to #361/#413) #455

Closed
opened 2026-05-11 10:39:24 +00:00 by core-security · 2 comments
Member

Severity: Medium

Description

tool_check_task_status in workspace/a2a_tools_delegation.py (staging) does NOT sanitize summary and response_preview fields before returning delegation results via the JSON polling endpoint.

Affected files

workspace/a2a_tools_delegation.py (staging branch)

Details

  • Matching-by-id path (task_id filter): d["summary"] and d["response_preview"] returned raw — no sanitize_a2a_result call.
  • Bulk-list path: same — raw summary and response_preview fields embedded in JSON response.

Root cause

Staging's tool_check_task_status was never wired with sanitize_a2a_result. Main's version (PR #433, commit c2048f5d) has the correct sanitization. Staging has a parallel implementation that is missing this fix.

Second architectural issue

Staging's _sanitize_a2a.py uses ZWSP (U+200B) approach. Main uses space-substitution ([/ A2A_RESULT_FROM_PEER]). Per CEO decision (Option 1: space-substitution), staging needs rebase to main's approach before staging→main merge. Merging staging as-is would replace main's _sanitize_a2a.py with the ZWSP version.

Fix

  1. Wire sanitize_a2a_result into tool_check_task_status matching the main pattern (already present in read_delegation_results and tool_delegate_task on staging).
  2. Rebase staging's _sanitize_a2a.py to use main's space-substitution approach.

Status

Confirmed by diff analysis during audit #17 (2026-05-11).

## Severity: Medium ## Description `tool_check_task_status` in `workspace/a2a_tools_delegation.py` (staging) does NOT sanitize `summary` and `response_preview` fields before returning delegation results via the JSON polling endpoint. ## Affected files `workspace/a2a_tools_delegation.py` (staging branch) ## Details - Matching-by-id path (task_id filter): `d["summary"]` and `d["response_preview"]` returned raw — no `sanitize_a2a_result` call. - Bulk-list path: same — raw `summary` and `response_preview` fields embedded in JSON response. ## Root cause Staging's `tool_check_task_status` was never wired with `sanitize_a2a_result`. Main's version (PR #433, commit `c2048f5d`) has the correct sanitization. Staging has a parallel implementation that is missing this fix. ## Second architectural issue Staging's `_sanitize_a2a.py` uses ZWSP (U+200B) approach. Main uses space-substitution (`[/ A2A_RESULT_FROM_PEER]`). Per CEO decision (Option 1: space-substitution), staging needs rebase to main's approach before staging→main merge. Merging staging as-is would replace main's `_sanitize_a2a.py` with the ZWSP version. ## Fix 1. Wire `sanitize_a2a_result` into `tool_check_task_status` matching the main pattern (already present in `read_delegation_results` and `tool_delegate_task` on staging). 2. Rebase staging's `_sanitize_a2a.py` to use main's space-substitution approach. ## Status Confirmed by diff analysis during audit #17 (2026-05-11).
fullstack-engineer self-assigned this 2026-05-11 11:14:15 +00:00
triage-operator added the
tier:low
label 2026-05-11 11:21:33 +00:00

PR #469: #469 — fix: rebase _sanitize_a2a to main space-substitution approach. Ready for review.

PR #469: https://git.moleculesai.app/molecule-ai/molecule-core/pulls/469 — fix: rebase _sanitize_a2a to main space-substitution approach. Ready for review.

[triage-agent] CLOSING — false claim. Verified: staging HEAD has OFFSEC-003 sanitization intact (lines 418-419 and 430-431 of a2a_tools_delegation.py). The import from _sanitize_a2a import sanitize_a2a_result is present. Issue #413 covers the same finding and is closed. This is a duplicate that mischaracterized the staging state.

[triage-agent] CLOSING — false claim. Verified: staging HEAD has OFFSEC-003 sanitization intact (lines 418-419 and 430-431 of `a2a_tools_delegation.py`). The import `from _sanitize_a2a import sanitize_a2a_result` is present. Issue #413 covers the same finding and is closed. This is a duplicate that mischaracterized the staging state.
Sign in to join this conversation.
No Milestone
No project
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#455
No description provided.