Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ctrl+k search dialog hotkey inside iframe #86

Merged
merged 1 commit into from
Mar 16, 2024
Merged

Conversation

JJ-8
Copy link
Owner

@JJ-8 JJ-8 commented Mar 16, 2024

Since the iframe is hosted on the same domain as the parent iframe, we can freely inject anything we want in the iframe. Therefore, we can control script execution and we use that to inject a specially crafted hotkeys-iframe.js file. This sounds like an exploit, but actually it is just the hotkeys-js library code together with a simple ctrl+k, command+k shortcut definition that posts a message to the parent frame that the search dialog should be shown. The parent will now act accordingly.

Therefore, the search dialog shortcuts now also work on the Hedgedoc iframe pages.

Since the iframe is hosted on the same domain as the parent iframe, we can freely inject anything we want in the iframe.
Therefore, we can control script execution and we use that to inject a specially crafted hotkeys-iframe.js file.
This sounds like an exploit, but actually it is just the hotkeys-js library code together with a simple `ctrl+k, command+k` shortcut definition
that posts a message to the parent frame that the search dialog should be shown.
The parent will now act accordingly.

Therefore, the search dialog shortcuts now also work on the Hedgedoc iframe pages.
@JJ-8 JJ-8 merged commit 91b6d31 into main Mar 16, 2024
1 check passed
@JJ-8 JJ-8 deleted the hotkeys-inside-iframe branch March 16, 2024 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant