Mozilla Foundation Security Advisory 2005-52
Same origin violation: frame calling top.focus()
- July 12, 2005
- Andreas Sandblad (Secunia)
- Firefox, Mozilla Suite
- Fixed in
- Firefox 1.0.5
- Mozilla Suite 1.7.10
A child frame can call top.focus() even if the framing page comes from a different origin and has overridden the focus() routine. The call is made in the context of the child frame. The attacker would look for a target site with a framed page that makes this call but doesn't verify that its parent comes from the same site. The attacker could steal cookies and passwords from the framed page, or take actions on behalf of a signed-in user. This attack would work only against sites that use frames in this manner.
Upgrade to a version containing the fix. As a website author verify that a parent frame is from the expected site before calling methods on it.