GHSA-fvqr-27wr-82fm CVE-2018-3721
Prototype Pollution in lodash
- Severity
- 6.5 / 10
- Medium · CVSS 3.1
- Exploit chance (EPSS)
- 2.35%
- Chance of exploitation in the next 30 days. Higher than 83.67% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-471 Modification of Assumed-Immutable Data (MAID)
- CWE-1321 Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
- Fix
- Available
- 2 packages have a fixed version
Description
Versions of lodash before 4.17.5 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 __proto__ causing the addition or modification of an existing property that will exist on all objects.
Recommendation
Update to version 4.17.5 or later.
Affected versions
RubyGems
| Package | Vulnerable | Fixed in |
|---|---|---|
| lodash-rails | < 4.17.5 |
4.17.5 |
| lodash-rails | < 4.17.5 |
4.17.5 |
npm
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.5
- bundler
bundle update lodash-rails # Gemfile: gem "lodash-rails", ">= 4.17.5"
lodash npm → 4.17.5
- npm
npm install lodash@4.17.5- yarn
yarn add lodash@4.17.5- pnpm
pnpm add lodash@4.17.5
Severity breakdown
CVSS 3.1 6.5
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- High
- Availability
- None
Weakness
CWE-471: Modification of Assumed-Immutable Data (MAID)
The product does not properly protect an assumed-immutable element from being modified by an attacker.
How to prevent it
- Architecture and Design, Operation, Implementation: When the data is stored or transmitted through untrusted sources that could modify the data, implement integrity checks to detect unauthorized modification, or store/transmit the data in a trusted location that is free from external influence.
CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.
How to prevent it
- Implementation: By freezing the object prototype first (for example, Object.freeze(Object.prototype)), modification of the prototype becomes impossible.
- Architecture and Design: By blocking modifications of attributes that resolve to object prototype, such as proto or prototype, this weakness can be mitigated.
- Implementation: When handling untrusted objects, validating using a schema can be used.
- Implementation: By using an object without prototypes (via Object.create(null) ), adding object prototype attributes by accessing the prototype via the special attributes becomes impossible, mitigating this weakness.
- Implementation: Map can be used instead of objects in most cases. If Map methods are used instead of object attributes, it is not possible to access the object prototype or modify it.
References
Advisories
Fixes and patches
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why 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
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