Repository navigation
validate origin in codeembed page messages - #11775
Open
Richard Knoll (riknoll) wants to merge 1 commit into
Open
Richard Knoll (riknoll) wants to merge 1 commit into
Richard Knoll (riknoll) wants to merge 1 commit into
Conversation
Richard Knoll (riknoll)
requested review from
a team
and
a balanced review from Copilot
November 19, 2026 22:01
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The origin check throws during local serving and rejects valid renderer origins in static builds, blocking the renderready handshake and leaving code embeds blank.
1 open issue
What changed in this PR
This PR adds origin validation to the shared-script code embed page, aiming to accept messages only from the configured editor origin.
Changes:
- Rejects messages whose origin differs from
pxtConfig.targetUrlbefore processing rendering messages.
| File | Description |
|---|---|
webapp/public/codeembed.html |
Adds an origin check to the iframe message handler. |
Review effort: Balanced
Joey Wunderlich (jwunderl)
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

this is the embed that's used for the code embed iframe in shared scripts.
the only domain that ever sends messages to this page is our editor, so enforce that requirement.