You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sandbox mediator posts and accepts messages without checking event.origin #16152
It never checks message.origin. The same file also sends every outbound message with a wildcard target origin: sendLocalMessage, sendMessage, and request all call postMessage(..., '*') (around lines 74-79 and 92).
MainClient uses this mediator to talk to the content iframe, including the initial MAINREADY payload and later USERDATAUPDATE messages. That payload includes the real userData object, which carries userId and userFullName.
Expected behavior
The mediator should only accept messages from the zipcontent origin (or whatever origin the sandbox iframe is served from), and pass that origin into postMessage instead of '*'.
It may also be worth not sending the real userId into the iframe and using a per-resource pseudonymous id instead, so sandboxed content does not need the learner's actual user id. Not sure if anything in the current handlers depends on the real id, so happy to discuss.
User-facing consequences
The sandbox iframe is meant to be isolated from the main Kolibri origin. Without an origin check, and with outbound messages sent to '*', the bridge is looser than it needs to be. Sending the real userId into the iframe also exposes more learner identity to sandboxed content than necessary.
Steps to reproduce
Open packages/kolibri-sandbox/src/mediator.js on develop.
In handleMessage, confirm the only sender check is message.source.
In sendLocalMessage, sendMessage, and request, confirm the target origin is '*'.
In packages/kolibri-sandbox/src/mainClient.js, initialize and _sendUserData forward userData (including userId) across the bridge.
Context
Kolibri version: develop (646b04dd)
Came up while reading through the sandbox handler work from PR #15036.
📝 This issue doesn't follow one of our issue templates yet. It is closest to Report a bug. Please edit the description to fix:
## AI usage is missing.
The check runs again when you save, and this comment goes away once it passes. We review the issue after that. If it still doesn't follow a template in 7 days, it will be closed.
Activity
learning-equality-bot commentedon Dec 3, 2026
📝 This issue doesn't follow one of our issue templates yet. It is closest to Report a bug. Please edit the description to fix:
## AI usageis missing.The check runs again when you save, and this comment goes away once it passes. We review the issue after that. If it still doesn't follow a template in 7 days, it will be closed.