feat(PUSH-834): loosen open_url scheme gate to allowlist#623
feat(PUSH-834): loosen open_url scheme gate to allowlist#623morrilltim wants to merge 4 commits into
Conversation
…, sms, smsto) Define openUrlAllowedSchemes in KlaviyoCore (and mirror it in KlaviyoSwiftExtension, which cannot depend on KlaviyoCore due to NSE sandbox). Update klaviyoWebUrl and isValidActionURLCombination to check the allowlist instead of the hard-coded ["http","https"] set. Dangerous schemes (intent, javascript, file, etc.) continue to be silently dropped. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- UNNotificationResponseExtensionTests: flip mailto: test to expect URL (not nil); add tel:, sms:, smsto: acceptance tests; add intent:, javascript:, file: rejection tests - KlaviyoActionButtonParserTests: rename SkipsOpenUrlWithNonHttpScheme (removed mailto: from blocked list) to SkipsOpenUrlWithBlockedScheme; add acceptance tests for mailto:, tel:, sms:; add rejection tests for intent:, javascript: - DeepLinkHandlingTests: add dispatch tests confirming .openWebUrl is sent for mailto: and tel: web_url values; add test confirming blocked schemes (javascript:) are dropped Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
All changes — including hotfixes, dependency bumps, and feature work — should flow through a To fix: change the base branch of this PR to the appropriate
Enforced by the |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c49bf4c. Configure here.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Action button open_url taps dispatched .openWebUrl without applying the scheme allowlist, so a blocked scheme could reach UIApplication.shared.open when the NSE skipped parser validation (non-empty categoryIdentifier). Apply openUrlAllowedSchemes at dispatch; blocked schemes are dropped with a warning while the tap event is still tracked. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Summary
Loosen the open_url action's http/https gate to an allowlist supporting mailto:, tel:, sms:, smsto: in addition to web schemes. No dispatch changes needed (UIApplication.shared.open is already scheme-agnostic).
Changes
Test Plan
Related
Part of PUSH-834 (multi-repo). Also see Android and fender PRs.
https://linear.app/klaviyo/issue/PUSH-834