Skip to content

[stable-7.1] fix: verify the sender of postMessage events in picker modals and external apps (#4289) - #4295

Merged
kulmann merged 1 commit into
stable-7.1from
backport/stable-7.1/pr-4289
Nov 5, 2026
Merged

kulmann merged 1 commit into
stable-7.1from
backport/stable-7.1/pr-4289

Conversation

@AlexAndBear

Copy link
Copy Markdown
Member

Backport

This will backport the following commits from main to stable-7.1:

The automatic backport had conflicts, so this is a manual port of the same checks to the 7.1 code:

  • FilePickerModal and SaveAsModal still use the Options API there, so the guard sits in their setup() handlers. onCancel is now returned from setup() so the specs can call it.
  • useCollaboraPostMessages doesn't exist on 7.1. The Collabora messages are handled inline in App.vue, so the source check went there, next to the UI_Edit one. The specs for it are in app.spec.ts.
  • The rest (the isMessageFromIframe helper and the checks in LocationPickerModal) is the same as on main.

Tested with the unit tests (forged source, forged origin and the legit path for every handler) and in the browser on a 7.1 build: forged select, file pick and cancel messages from another origin worked on stable-7.1 and are ignored with this change, while Copy to, Move to, Save as, file pick and the Collabora insert graphic flow still work.

@kulmann
kulmann merged commit b4e95e5 into stable-7.1 Nov 5, 2026
27 checks passed
@kulmann
kulmann deleted the backport/stable-7.1/pr-4289 branch November 5, 2026 09:57
@openclouders openclouders mentioned this pull request Nov 5, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants