security: iframe sandbox allows same-origin access to parent page
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 45/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- typescript
Rechercherichtung
Start at apps/app/src/components/generative-ui/widget-renderer.tsx:523 and inspect how the iframe sandbox and postMessage bridge are configured. Test what breaks when allow-same-origin is removed, including any CDN or fetch behavior mentioned in the issue. Done means the sandbox uses only the permissions required by the renderer, the bridge still works, and the intentional security tradeoff is documented if the permission must remain.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Description
Severity: P0 — Security
In apps/app/src/components/generative-ui/widget-renderer.tsx:523, the iframe sandbox attribute is:
sandbox="allow-scripts allow-same-origin"
The combination of allow-scripts + allow-same-origin allows the iframe to access window.parent and all parent DOM/cookies. While the CSP mitigates remote script loading, agent-generated HTML with inline scripts has full same-origin access to the host page.
Failure mode
XSS via agent-generated content — malicious or hallucinated HTML could read/modify parent page state, steal cookies, or call CopilotKit APIs.
Suggested fix
Remove allow-same-origin from the sandbox. The iframe only needs allow-scripts. The postMessage bridge already works cross-origin. If allow-same-origin is truly required (e.g., for CDN fetches), tighten CSP connect-src and document the tradeoff.
Open question
Is allow-same-origin intentional? What breaks if it's removed?
From self-review finding F01
- Vorherrschende Sprache
- TypeScript
- Sterne
- 1.6k
- Forks
- 202
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus CopilotKit/OpenGenerativeUI
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
CopilotKit/OpenGenerativeUI#87 · 2 Kommentare ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
Alle Issues in CopilotKit/OpenGenerativeUI
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
0xMiden/bridge-portal#132 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
area:tools bug good first issue help wanted priority:P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
newrelic-experimental/preflight#793 · 1 Kommentar ·