Open Bug 1894056 Opened 1 month ago Updated 1 month ago

Firefox allows iframe to focus on itself. This can be exploited to perform key logging.

Categories

(Core :: DOM: Core & HTML, defect, P3)

Firefox 125
defect

Tracking

()

People

(Reporter: yadhukrishna.mpm, Unassigned)

References

Details

Attachments

(3 files)

Attached file poc-html.zip

Steps to reproduce:

  1. Open index.html in firefox.
  2. index.html loads attacker.html from a cross-origin.
  3. Whenever user types anything on the main page, the focus is shifted to the iframe, which can leak key strokes.

Actual results:

Firefox allows embedding of cross-domain iframe or embed tag to focus on itself by default, and can listen to key strokes. A third-party embed can happily listen to user key strokes. This should not be allowed by default.

Expected results:

iframes and embeds should not be allowed to focus on elements inside itself to prevent keylogging. Given that embed tag and iframes are widely used, and an attacker has control over the content inside an iframe, they can listen to keystroke events. The trust boundary is bypassed.

Attached file attacker.html

For convenience, here are the two HTML files from the attached zip. I don't know if the test will work if run directly from Bugzilla.

Group: firefox-core-security → dom-core-security
Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core

I found this old but unfixed discussion about adding a way to block this, so it sounds like it is just an unfortunate feature of the web platform: https://github.com/w3c/webappsec-permissions-policy/issues/273

Same behaviour in Chrome. Safari is slightly different, I need to focus the iframe at least once but then it works too.

I have raised this issue with Chrome team. They are looking into it.

This issue is already publicly known so it doesn't need to be hidden

Status: UNCONFIRMED → NEW
Ever confirmed: true
Group: dom-core-security
Severity: -- → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: