The vulnerability allows for a sandbox escape by overwriting properties of whitelisted prototypes, specifically Map.prototype.has as demonstrated in the proof-of-concept. This is a form of prototype pollution. The fixing commit 67cb186c41c78c51464f70405504e8ef0a6e43c3 addresses this by hardening the property assignment and access logic.
The primary vulnerable function is assignCheck in src/executor.ts. This function is responsible for validating property assignments within the sandboxed code. The original implementation used obj.context.hasOwnProperty(obj.prop) to check if a property is an own property. This check could be bypassed if an attacker first pollutes Object.prototype to overwrite hasOwnProperty. The patch replaces this vulnerable call with a locally defined, non-pollutable hasOwnProperty function, thus closing the loophole.
Additionally, the Scope.get method in src/utils.ts was also using hasOwnProperty in a potentially unsafe manner, which was refactored in the patch. While assignCheck is the most direct function related to the exploit, Scope.get is also part of the vulnerable logic chain for variable and property resolution.
Therefore, any exploit triggering this vulnerability would have assignCheck in its runtime profile during the malicious assignment operation.