Repository navigation
chore: block cross-origin postMessage in preview iframe - #597
Merged
Mukesh-FN merged 1 commit intoOct 12, 2026
Merged
Conversation
Mukesh-FN
requested review from
AlanFnz,
Amin52J,
chrisrolfe198 and
lizzielerwill-ctrl
as code owners
October 12, 2026 15:37
commit: |
Mukesh-FN
deleted the
UIUX-2123/bug-bounty-dom-xss-via-unvalidated-postmessage
branch
October 12, 2026 16:13
Contributor
|
🎉 This PR is included in version 3.0.0-rc.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 27, 2026
## 2.67.0 (2026-10-27) * feat: add magnifier eye icon (#599) ([b2a83bf](b2a83bf)), closes [#599](#599) * ci: pause merge-main while Wave 3 release candidates are on next (#598) ([34dd5e1](34dd5e1)), closes [#598](#598) * chore: block cross-origin postMessage in preview iframe (#597) ([bb00408](bb00408)), closes [#597](#597)
Contributor
|
🎉 This PR is included in version 2.67.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
What
Blocks cross-origin
postMessageevents in the Storybook preview (iframe.html) served at wave.free-now.com.Media
N/A: no visual changes.
Why
Storybook's preview channel handles every
storybook-channelmessage without checking the sender's origin. Any external site could openiframe.htmlin a popup and sendupdateStoryArgsto set arbitrary story args. Components that pass props through to the DOM, such asBox, would then render attacker-supplied HTML viadangerouslySetInnerHTML, running script on the wave.free-now.com origin.index.html) isn't affected, because it only accepts messages from its own preview iframes.Relates to UIUX-2123 (Bug bounty: DOM XSS via Unvalidated postMessage).
How
.storybook/preview-head.htmlthat registers a capture-phasemessagelistener. For any message whoseoriginisn't the page's own origin, it callsstopImmediatePropagation().preview-head.htmlinto the<head>ofiframe.htmlbefore its bundles load, so this check always runs before Storybook's own listener.refs) or embed cross-origin iframes, so nothing we rely on is blocked.chore, so semantic-release won't publish a new@freenow/waveversion. The docs site redeploys when this merges tomain.Tested in headless Chromium against the current production build (from
gh-pages), with the attack sent from a separate origin: