Skip to content

fix(security): scope Optimizely OAuth token postMessage to app origin [] - #11275

Merged
Mitch Goudy (mgoudy91) merged 1 commit into
masterfrom
mgoudy/fix-optimizely-postmessage-origin
Aug 18, 2026
Merged

fix(security): scope Optimizely OAuth token postMessage to app origin []#11275
Mitch Goudy (mgoudy91) merged 1 commit into
masterfrom
mgoudy/fix-optimizely-postmessage-origin

Conversation

@mgoudy91

@mgoudy91 Mitch Goudy (mgoudy91) commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Optimizely's OAuth callback (apps/optimizely/src/index.jsx:35) forwarded the freshly-minted access token to window.opener via postMessage with target origin '*', so the browser delivers it regardless of the opener tab's current origin (CWE-346).
  • Scopes the target origin to window.location.origin instead, matching the fix already applied to Typeform, Slack, and Smartling under AIS-298 — Optimizely was missed from that pass.
  • The receiving message listener in this file already validates event.origin correctly, so this closes the one remaining gap on the send side.

Test plan

  • yarn workspace optimizely test (or repo-equivalent) passes
  • Manually connect the Optimizely app in a Contentful environment and confirm the OAuth popup flow still authenticates successfully

The OAuth callback broadcast the freshly-minted access token to
window.opener with target origin '*', so the browser would deliver it
regardless of what origin the opener tab currently held (CWE-346).
Typeform, Slack, and Smartling had the same issue fixed under AIS-298;
Optimizely was missed.
@mgoudy91
Mitch Goudy (mgoudy91) requested review from a team as code owners August 18, 2026 15:10
@mgoudy91 Mitch Goudy (mgoudy91) changed the title fix(security): scope Optimizely OAuth token postMessage to app origin fix(security): scope Optimizely OAuth token postMessage to app origin [] Aug 18, 2026
@mgoudy91
Mitch Goudy (mgoudy91) enabled auto-merge (squash) August 18, 2026 15:13

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mgoudy91
Mitch Goudy (mgoudy91) merged commit 1688b81 into master Aug 18, 2026
15 of 17 checks passed
@mgoudy91
Mitch Goudy (mgoudy91) deleted the mgoudy/fix-optimizely-postmessage-origin branch August 18, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants