ADE-68: Orchestration & CTO: worker sandbox escape / webFetch SSRF (P1) + plan.md images, dead CTO buttons, manifest integrity, automation guard, dead webhook, decomposition#496
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Warning Review limit reached
More reviews will be available in 36 minutes and 5 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (26)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@copilot review but do not make fixes |
|
Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
d1bd6c5 to
f8c13e9
Compare
|
@copilot review but do not make fixes |
|
@copilot review but do not make fixes |
8b84a4b to
2bbad3e
Compare
|
@copilot review but do not make fixes |
2bbad3e to
9d93933
Compare
|
@copilot review but do not make fixes |
Refs ADE-68
Summary
Describe the change.
What Changed
Key files and behaviors.
Validation
How you tested.
Risks
Anything to watch.
Linked Linear issues
Greptile Summary
This PR addresses a broad set of security hardening and correctness issues across the orchestration layer, webFetch SSRF guards, worker sandbox, CTO UI, and automation scheduling. The changes are generally well-scoped and come with solid test coverage.
webFetch.tsnow resolves DNS once, validates every returned address, then connects to the pinned IP viahttp/https.requestwhile preservingHost/SNI — closing the DNS-rebinding window flagged in a prior review. Reserved IPv4 ranges are now blocked with a new test file covering the guard.buildOrchestrationSandboxConfigstripsnodeandtsxfrom the safe-command list; a new early-exit incheckWorkerSandboxblocks interpreter-payload commands whenblockByDefaultistrue.heartbeats.jsonfile, eliminating etag churn and concurrency conflicts. Automation run serialization queues concurrent triggers rather than dropping them. The missinglocalSigningSecret = payload.signingSecretassignment inlinearIngressService.tsis fixed.Confidence Score: 5/5
Safe to merge; the changes are net-positive security hardening with good test coverage across all major paths.
The DNS-pinning SSRF fix, sandbox-escape mitigations, manifest integrity checks, and heartbeat separation are all well-implemented and covered by new tests. The one open gap (unbounded response-body buffering in requestPinnedTarget) is a latent DoS surface rather than a code-correctness regression, and the 15-second AbortController timeout bounds the worst case.
webFetch.ts — the requestPinnedTarget function buffers the full HTTP response body with no size cap.
Important Files Changed
Sequence Diagram
sequenceDiagram participant Tool as webFetch tool participant SSRF as assertSafeWebFetchUrl participant DNS as dns.lookup participant Node as http/https.request (pinned IP) participant Server as Remote Server Tool->>SSRF: assertSafeWebFetchUrl(startUrl) SSRF->>DNS: "lookup(hostname, {all:true})" DNS-->>SSRF: [ip1, ip2, ...] SSRF->>SSRF: isBlockedNetworkAddress(each ip) SSRF-->>Tool: "{resolvedAddress, hostHeader, servername, url}" loop up to MAX_REDIRECTS (5) Tool->>Node: requestPinnedTarget(pinnedTarget, signal) Note over Node,Server: hostname=resolvedAddress, Host=hostHeader, SNI=servername Node->>Server: TCP connect to resolved IP Server-->>Node: HTTP response Node-->>Tool: Response alt 3xx + Location header Tool->>SSRF: assertSafeWebFetchUrl(redirectUrl) SSRF->>DNS: "lookup(newHostname, {all:true})" DNS-->>SSRF: [newIp, ...] SSRF-->>Tool: new pinnedTarget else non-redirect Tool-->>Tool: return Response end endComments Outside Diff (2)
apps/desktop/src/renderer/components/orchestration/PlanMarkdown.tsx, line 238-245 (link)dangerouslySetInnerHTMLThe
svgstring produced bymermaid.render()is inserted directly into the DOM without any secondary sanitization. Mermaid'ssecurityLevel: "strict"is the only safeguard. If a bug in mermaid's renderer allows a crafted diagram (e.g. injected viaplan.mdwritten by a prompt-injected agent) to escape the strict mode sandbox, the resulting SVG would execute arbitrary scripts in the Electron renderer process. Consider running the SVG through a DOMPurify pass after rendering (DOMPurify.sanitize(res.svg, { USE_PROFILES: { svg: true, svgFilters: true } })) before settingdangerouslySetInnerHTML.Prompt To Fix With AI
apps/desktop/src/main/services/ai/tools/workerSandboxDefaults.ts, line 44-54 (link)noderemains in the non-orchestrationsafeCommandsallow-listDEFAULT_WORKER_SANDBOX_CONFIGincludes"^node(\\.exe)?\\s"as a safe command withblockByDefault: false. Any non-orchestration worker that uses this default config can execute arbitrarynode ...commands.buildOrchestrationSandboxConfigcorrectly strips this for orchestration workers, but the base config is permissive. Consider whether it would be safer to flipblockByDefaulttotruefor the base config, or to removenodefrom the base allow-list and add it back only where explicitly needed.Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix All With AI
Reviews (5): Last reviewed commit: "ship: fix webFetch pinning and cancellat..." | Re-trigger Greptile