Skip to content

fix: verify the sender of postMessage events in picker modals and external apps - #4289

Merged
AlexAndBear merged 1 commit into
mainfrom
fix/verify-postmessage-sender
Nov 5, 2026
Merged

AlexAndBear merged 1 commit into
mainfrom
fix/verify-postmessage-sender

Conversation

@kulmann

@kulmann kulmann commented Nov 5, 2026

Copy link
Copy Markdown
Member

Description

The file picker, location picker and "Save as" modals and the external app iframes (Collabora, Microsoft Office) accepted postMessage events from any window. A malicious page or frame could send fake opencloud-embed:* or Collabora/WOPI messages to trigger picks, cancels or edit-mode switches.

A new helper, isMessageFromIframe, now checks that each message comes from the expected iframe's contentWindow. For the picker modals, which load our own embed URL, it also checks the expected origin. Messages that fail these checks are ignored.

Security finding reported by zerox80. Thank you very much!

How Has This Been Tested?

  • test environment: unit tests (Vitest)
  • test case 1: picker and "Save as" modals ignore messages from a foreign source or origin and still handle messages from their own iframe
  • test case 2: Collabora/external app handlers ignore messages that don't come from the app iframe
  • test case 3: unit tests for isMessageFromIframe

@kulmann kulmann self-assigned this Nov 5, 2026
@kulmann kulmann added Type:Bug Type:Security backport-required Needs a backport to the current stable branch labels Nov 5, 2026
@AlexAndBear
AlexAndBear merged commit 3d8143b into main Nov 5, 2026
31 checks passed
@AlexAndBear
AlexAndBear deleted the fix/verify-postmessage-sender branch November 5, 2026 07:58
@openclouders openclouders mentioned this pull request Nov 5, 2026
1 task
kulmann added a commit that referenced this pull request Nov 5, 2026
[stable-7.1] fix: verify the sender of postMessage events in picker modals and external apps (#4289)
@openclouders openclouders mentioned this pull request Nov 5, 2026
1 task
v-scharf pushed a commit that referenced this pull request Nov 11, 2026
* fix: escape notification messages and interpolate placeholders in one pass

* fix: verify the sender of postMessage events in picker modals and external apps (#4289)

* fix: sanitize search result highlights

* ci: replace minio image

* chore: bump version to v4.2.3

* ci: invalidate stale playwright browsers cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-required Needs a backport to the current stable branch Type:Bug Type:Security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants