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
Shortly after the 1.2.1 release, XmiliaH reported a new vulnerability in the shim. As explained in the blog post, we have stopped applying timely security fixes to the realms shim, so this represents an unfixed sandbox escape in the shim.
The arrayConcat function is a safely-curried version of Array.prototype.concat, so it will behave as specified, but the official JavaScript specification has an interesting property: the type of the resulting Array is decided by the constructor of the first argument. Since the user's localTransforms appears first, it gets to be involved in the creation of the new Array. The attack uses this access to grab a reference to the host's Array object (which comes from the primal Realm). From there it climbs the prototype chain until it reaches the unsafe eval.
One fix is to supply a real Array for the first argument to concat:
Shortly after the 1.2.1 release, XmiliaH reported a new vulnerability in the shim. As explained in the blog post, we have stopped applying timely security fixes to the realms shim, so this represents an unfixed sandbox escape in the shim.
@XmiliaH's exploit looks like this:
It works against the "fixed" 1.2.1 code, in which the user-supplied
transforms
option is combined with additional transforms, usingconcat
:The
arrayConcat
function is a safely-curried version ofArray.prototype.concat
, so it will behave as specified, but the official JavaScript specification has an interesting property: the type of the resulting Array is decided by the constructor of the first argument. Since the user'slocalTransforms
appears first, it gets to be involved in the creation of the new Array. The attack uses this access to grab a reference to the host'sArray
object (which comes from the primal Realm). From there it climbs the prototype chain until it reaches the unsafeeval
.One fix is to supply a real Array for the first argument to
concat
:But a more-obviously-correct fix is to use an Array literal and the "spread operator" (
...
):This approach asks each argument for an iterator, but does not otherwise depend upon methods or types of the arguments.
The text was updated successfully, but these errors were encountered: