Skip to content

Embed mode accepts delegated tokens from windows other than the host #4296

Closed

Description

@AlexAndBear

Initial Checklist

  • I understand this is a bug report and questions should be posted in the Community Discussions
  • I searched issues and couldn’t find anything (or linked relevant results below)

Bug Description

In embed mode with delegated authentication, the listeners that take the access token from the host (opencloud-embed:update-token in authService.ts and the initially requested token in oidcCallback.vue) don't check who sent the message. They only compare the origin when embed-delegate-authentication-origin is set. Without that option, any window that can post a message to the embedded frame can hand Web a different token, and Web then runs as that account. Follow-up to #4289, which added the same kind of sender check to the picker modals.

Reproduction Steps

  1. Embed Web with embed=true&embed-delegate-authentication=true, without embed-delegate-authentication-origin
  2. From a window other than the embedding host, post an opencloud-embed:update-token message with another account's token into the embedded frame

Expected Outcome

Web only accepts tokens sent by the host that embeds it.

Actual Outcome

Web accepts the token and continues as the other account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions