Skip to content

Cross-Origin Frame Access Issues on ios 18.5 #262

Closed

Description

@rodolfoBee

Platform

iOS

Environment

Production

Installed

Swift Package Manager

Version

8.47.0

Xcode Version

na

Did it work on previous versions?

No response

Steps to Reproduce

  1. Create a page served in domainapp.domain.com and an embedded iframe that handles authentication served in auth.domain.com.
  2. Add the sentry SDK with replays enabled to the app.

SDK init:

_loaderInitConfig = {
dsn: ‘***’,
tracesSampleRate: 1.0,
replaysSessionSampleRate: 0.1, // -> 0.0
replaysOnErrorSampleRate: 1.0, // -> 0.0
autoSessionTracking: true, // -> false
integrations: (defaultIntegrations) => defaultIntegrations,
tracePropagationTargets: [‘localhost’, /^//],
};

Expected Result

No errors.

Actual Result

When running on ios 18.5 the follow error is raised:

Blocked a frame with origin "https://app.domain.com" from accessing a frame with origin "https://auth.domain.com". Protocols, domains, and ports must match.

Current findings from the user:

  • The issue occurs only in iOS 18.5 Safari WebView (in our hybrid app environment).
    On macOS Safari 18.5, the same flow works without any problem.
    A critical API call made after an authentication process fails silently in iOS 18.5 WebView only when Sentry Replay is enabled.
    When Replay is disabled (replaysSessionSampleRate = 0.0, replaysOnErrorSampleRate = 0.0), the issue no longer occurs.
  • Our login process involves embedding a cross-origin iframe that handles authentication.
    After authentication completes, the parent page makes an API call, but in the problematic environment, the request does not reach the server.
    We suspect that the issue is related to how Replay captures or interacts with iframes in the iOS 18.5 WebView environment.
  • Since this issue only occurs in iOS 18.5 Safari WebView with Replay enabled, we suspect there may be a conflict caused by Replay’s internal mechanisms (such as iframe instrumentation or session capture logic).

The issue does not happen on ios 18.3 or lower.

Reported in this internal ticket. .

Are you willing to submit a PR?

No response

Activity

  1. added theissue type on Jul 24, 2025
  2. linear commented on Jul 24, 2025

    @linear
  3. added theissue type on Jul 24, 2025
  4. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jul 24, 2025
  5. linear commented on Jul 24, 2025

    @linear
  6. mydea commented on Jul 25, 2025

    @mydea
    Member

    cc @billyvg could you maybe take a look at this?

  7. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jul 25, 2025
  8. billyvg commented on Jul 30, 2025

    @billyvg
    Member

    Seems similar to getsentry/sentry-javascript#13173 -- though it's surprising the invalid frame access is breaking their login process. We may want to consider not recording iframes by default

  9. mydea commented on Aug 5, 2025

    @mydea
    Member

    so, they need to block the iframe manually? I guess blocking iframes by default is likely breaking, maybe we should at least document this well…?

  10. removed
    bugSomething isn't working
    on Aug 5, 2025
  11. self-assigned this
    on Aug 5, 2025
  12. 4 remaining items

  13. andreiborza commented on Jan 20, 2026

    @andreiborza
    Member

    Transferred this here, I think we just need to try/catch when accessing iframe content.

  14. added 8 commits that reference this issue on Mar 31, 2026
    ddd1f89
    91e5169
    4f100f1
    d28fb16
    f61528c
    088e76b
    b4f19d5
    a576a34
  15. added a commit that references this issue on Mar 31, 2026
    2bc97b4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions