Repository navigation
fix(media): prevent provider-generated text from injecting delivery directives - #118780
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 2:25 PM ET / 18:25 UTC. ClawSweeper reviewWhat this changesSanitizes provider-generated image, music, and video display text so it cannot create media, reply, reaction, voice, Markdown-image, or fence directives, while preserving exact structured attachment records. Merge readinessThe PR remains necessary: current Priority: P1 Review scores
Verification
How this fits togetherImage, music, and video generation tools receive provider results and produce both human-readable tool text and structured media attachments. Tool text can later pass through reply-directive parsing and outbound planning, while structured attachment paths and URLs identify the intended media independently. flowchart LR
A[Provider result] --> B[Media generation tool]
B --> C[Generated-media display formatter]
C --> D[Agent or internal-event text]
D --> E[Reply directive parser]
E --> F[Outbound delivery plan]
B --> G[Structured attachment metadata]
G --> F
Before merge
Agent review detailsSecurityNone. PR surfaceSource +41, Tests +169. Total +210 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one shared generated-media display sanitizer for untrusted provider presentation, retain exact structured attachment metadata for delivery, and land the focused image/music/video regression coverage after maintainer approval. Do we have a high-confidence way to reproduce the issue? Yes: current Is this the best way to solve the issue? Yes: placing sanitization in AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 05dc73bb35fd. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* commit 'efcced7207baa0b1b1db5e8e1836673a24212657': test(agents): prove process control roundtrip (#118843) test(qa): add memory redaction boundary coverage (#118916) fix(kilocode): model discovery overstates the usable context window (#118868) fix(media): isolate generated-provider text from delivery directives (#118780) test(gateway): add node control-plane QA coverage (#118784) fix(config): reject unsupported diagnostics otel grpc (#93087) fix(providers): recognize configured media credentials across provider boundaries (#118761) refactor: delete dead post-landing plugin/hooks scaffolding (#118920) fix(cron): deliver child results after heartbeat-only parent responses (#118743) fix(ci): keep Matrix chunk tests aligned with inventory (#118917) fix(tts): preserve hidden speech answers when synthesis fails (#118690)
…-worker-update-20260803 * origin/main: (48 commits) test(ui): add shell and PWA primary QA proof (#118788) test(qa): cover CLI distribution workflows (#118948) chore(i18n): refresh native locales (#118883) test(qa): prove plugin tool ownership in gateway flow (#118958) docs: correct onboarding risk flags and Google Chat credential shapes (#118936) fix(imessage): honor explicitly enabled accounts during startup (#118944) test(gateway): cover client transport defaults (#118798) fix(signal): normalize accounts during noninteractive setup (#118932) fix(msteams): enable channels for federated environment credentials (#118931) fix(openai): enforce final transcript bounds before callback delivery (#118928) test(tasks): cover plugin-managed flows (#118919) test(agents): prove process control roundtrip (#118843) test(qa): add memory redaction boundary coverage (#118916) fix(kilocode): model discovery overstates the usable context window (#118868) fix(media): isolate generated-provider text from delivery directives (#118780) test(gateway): add node control-plane QA coverage (#118784) fix(config): reject unsupported diagnostics otel grpc (#93087) fix(providers): recognize configured media credentials across provider boundaries (#118761) refactor: delete dead post-landing plugin/hooks scaffolding (#118920) fix(cron): deliver child results after heartbeat-only parent responses (#118743) ...
Summary
Actual production-path security proof
Actual loopback production provider + canonical outbound proof
The actual bundled OpenAI video provider executed 30 real authenticated loopback HTTP requests (
POST /v1/videos, thenGET /v1/videos/qa_video_118780/content?variant=video) across 15 malicious upstream-response cases. Credentials and endpoint were synthetic; no external paid/live provider was contacted.Each response injected combinations of
MEDIA:/tmp/..., Markdown images, reply redirects, voice/reaction tags, LF/CRLF/escaped newlines, bidi/control characters, and backtick/tilde fences. The realvideo_generateowner persisted the 32-byte download unchanged (SHA256cce9c9fd7e9af77862cdae9a8aaeffd7608c16d0f3cc29063c9f3e497b80265b); the actual detached event formatter, reply parser, and canonical outbound planner then delivered exactly one intended original-byte attachment with zero forged attachments, reply redirects, voice conversions, or reactions in all 15 cases.{"provider":"actual bundled OpenAI video adapter","transport":"real authenticated localhost HTTP","externalProviderCalled":false,"httpRequests":30,"adversarialProviderResponses":15,"intendedAttachmentsDelivered":15,"forgedAttachments":0,"replyHijacks":0,"voiceHijacks":0,"reactionHijacks":0,"failures":0}The project-owner-authored PR explicitly accepts the disclosed absence of an external paid/live provider: real provider HTTP ingress, hostile upstream payloads, binary download, production persistence, detached delivery, and final outbound planning have all been exercised end to end.