vendor:
Safari
by:
Project Zero
8,8
CVSS
HIGH
Node Removal Vulnerability
20
CWE
Product Name: Safari
Affected Version From: Safari 10.0.3
Affected Version To: Safari 10.0.3
Patch Exists: YES
Related CWE: N/A
CPE: a:apple:safari:10.0.3
Metasploit:
N/A
Other Scripts:
N/A
Tags: N/A
CVSS Metrics: N/A
Nuclei References:
N/A
Nuclei Metadata: N/A
Platforms Tested: Mac
2017
Node Removal Vulnerability in Container::replaceAllChildren
This vulnerability is related to the Container::replaceAllChildren function in which if the location hash value is set, the page will give focus to the associated element. However, if there is a stylesheet that has not been loaded yet, the focusing will be delayed until the stylesheet gets loaded. The problem is that when the link element linked to the last pending stylesheet is removed from the parent, the notifyChildNodeRemoved function may end up to fire a focus event which runs arbitrary JavaScript code, which can make an iframe(|g| in the PoC) that has an attached frame but has no parent.
Mitigation:
The user should ensure that the stylesheets are loaded before the focus event is fired.