Skip to content

GHSA-4xc9-xhrj-v574 CVE-2018-16487

Prototype Pollution in lodash

High RubyGemsnpm
Severity
High
The publisher's own rating, not a CVSS score
Exploit chance (EPSS)
1.49%
Chance of exploitation in the next 30 days. Higher than 74.13% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-400 Uncontrolled Resource Consumption
Fix
Available
2 packages have a fixed version

Description

Versions of lodash before 4.17.11 are vulnerable to prototype pollution.

The vulnerable functions are 'defaultsDeep', 'merge', and 'mergeWith' which allow a malicious user to modify the prototype of Object via {constructor: {prototype: {...}}} causing the addition or modification of an existing property that will exist on all objects.

Recommendation

Update to version 4.17.11 or later.

Affected versions

RubyGems

PackageVulnerableFixed in
lodash-rails
< 4.17.11
4.17.11
lodash-rails
< 4.17.11
4.17.11

npm

PackageVulnerableFixed in
lodash
< 4.17.11
4.17.11
lodash
< 4.17.11
4.17.11

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

lodash-rails RubyGems → 4.17.11

bundler
bundle update lodash-rails # Gemfile: gem "lodash-rails", ">= 4.17.11"

lodash npm → 4.17.11

npm
npm install lodash@4.17.11
yarn
yarn add lodash@4.17.11
pnpm
pnpm add lodash@4.17.11

Weakness

CWE-400: Uncontrolled Resource Consumption

The product does not properly control the allocation and maintenance of a limited resource.

How to prevent it
  • Architecture and Design: Design throttling mechanisms into the system architecture. The best protection is to limit the amount of resources that an unauthorized user can cause to be expended. A strong authentication and access control model will help prevent such attacks from occurring in the first place. The login application should be protected against DoS attacks as much as possible. Limiting the database access, perhaps by caching result sets, can help minimize the resources expended. To further limit the potential for a DoS attack, consider tracking the rate of requests received from users and blocking requests that exceed a defined rate threshold.
  • Architecture and Design: Mitigation of resource exhaustion attacks requires that the target system either: recognizes the attack and denies that user further access for a given amount of time, or uniformly throttles all requests in order to make it more difficult to consume resources more quickly than they can again be freed. The first of these solutions is an issue in itself though, since it may allow attackers to prevent the use of the system by a particular valid user. If the attacker impersonates the valid user, they may be able to prevent the user from accessing the server in question. The second solution is simply difficult to effectively institute -- and even when properly done, it does not provide a full solution. It simply makes the attack require more resources on the part of the attacker.
  • Architecture and Design: Ensure that protocols have specific limits of scale placed on them.
  • Implementation: Ensure that all failures in resource allocation place the system into a safe posture.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-r5fr-rjxr-66jc
lodash vulnerable to Code Injection via `_.template` imports key names
Critical Also affects lodash
GHSA-f23m-r3pf-42rh
lodash vulnerable to Prototype Pollution via array path bypass in `_.unset` and `_.omit`
Medium Also affects lodash
GHSA-xxjr-mmjv-4gpg
Lodash has Prototype Pollution Vulnerability in `_.unset` and `_.omit` functions
Medium Also affects lodash
GHSA-29mw-wpgm-hmr9
Regular Expression Denial of Service (ReDoS) in lodash
Medium Also affects lodash
GHSA-35jh-r3h4-6jhm
Command Injection in lodash
High Also affects lodash
GHSA-p6mc-m468-83gw
Prototype Pollution in lodash
High Also affects lodash
GHSA-x5rq-j2xg-h7qm
Regular Expression Denial of Service (ReDoS) in lodash
Medium Also affects lodash
GHSA-jf85-cpcp-j695
Prototype Pollution in lodash
Critical Also affects lodash

Credits: G-Rath

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor