added same origin for interstitial web popup#501
added same origin for interstitial web popup#501AshwinSaxena01 wants to merge 7 commits intodevelopfrom
Conversation
…rade npm for OIDC support
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughThe changes extend iframe sandbox permissions by adding 'allow-same-origin' to sandbox attributes in preview scenarios with custom-editor enabled. Two files are updated with identical sandbox attribute modifications affecting iframe security policies. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
|
|
||
| if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) { | ||
| iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'; | ||
| iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox allow-same-origin'; |
There was a problem hiding this comment.
Iframe sandbox bypass allows script access to parent
High Severity
Adding allow-same-origin to the iframe sandbox that already has allow-scripts effectively defeats sandbox protection. This combination allows sandboxed content to access the parent page's DOM, cookies, localStorage, and even remove the sandbox attribute entirely. Since the iframe loads HTML content from targetingMsgJson.msgContent.html (campaign content that may be remotely sourced), any compromise of that content could lead to full access to the parent page. MDN explicitly warns against using allow-scripts and allow-same-origin together when the embedded document shares the same origin as the embedding page.
Changes
Describe the key changes in this PR with the Jira Issue reference
Changes to Public Facing API if any
Please list the impact on the public facing API if any
How Has This Been Tested?
Describe the testing approach and any relevant configurations (e.g., environment, platform)
Checklist
Link to Deployed SDK
Use these url for testing :
https://static.wizrocket.com/staging/<CURRENT_BRANCH_NAME>/js/clevertap.min.jshttps://static.wizrocket.com/staging/<CURRENT_BRANCH_NAME>/js/sw_webpush.min.jsHow to trigger Automations
Just add a empty commit after all your changes are done in the PR with the command
git commit --allow-empty -m "[run-test] Testing Automation"This will trigger the automation suite
Note
Expands iframe sandbox permissions for previewed interstitials using the custom editor.
clevertap.jsto addallow-same-origintoiframe.sandboxwhendisplay.previewanddisplay['custom-editor']are enabled, enabling same-origin access in the preview contextWritten by Cursor Bugbot for commit f5039a9. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.