CVE-2020-7720: Prototype Pollution in node-forge

node-forge Updated 02 Oct 2025

Summary

14/09/2020
Yes i
High
8.8

CVE-2020-7720: Prototype Pollution in node-forge. Affects node-forge versions < 0.10.0. Fixed in 0.10.0. How to fix ↓

Also tracked for

The same CVE-2020-7720 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

node-forge is an npm package that provides a set of cryptographic utilities for JavaScript. It is commonly used for tasks such as encryption, decryption, digital signatures, and certificate management. The package allows developers to perform various cryptographic operations in their applications. However, versions prior to 0.10.0 are vulnerable to Prototype Pollution through the util.setPath function. This vulnerability can lead to the modification of an object's prototype, potentially resulting in unauthorized access, data manipulation, or remote code execution.

Vulnerability Detail

The vulnerability in node-forge arises from the util.setPath function, which is susceptible to Prototype Pollution. Prototype Pollution is a type of vulnerability that occurs when an attacker can modify the prototype of an object. By manipulating the prototype, an attacker can inject malicious properties or methods into the object, leading to unexpected behavior or security breaches. In the case of node-forge, this vulnerability could be exploited to compromise the integrity and confidentiality of cryptographic operations performed by the package.

How To Fix

Latest published version: 1.4.0 as of 22 Oct 2026

npm install node-forge@1.4.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.10.0

This is the first release that contains the fix.

npm install node-forge@0.10.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a workaround, developers can manually modify the affected function in their code to prevent the vulnerability. Here is an example of how the forge.util.setPath function can be modified to address the issue:

// Original vulnerable function
function setPath(obj, path, value) {
  // Vulnerable code
}

// Modified function to mitigate the vulnerability
function setPath(obj, path, value) {
  if (typeof obj !== 'object' || obj === null) {
    obj = {};
  }
  // Safe code
}

Conclusion

The vulnerability in node-forge prior to version 0.10.0 exposes applications to the risk of Prototype Pollution. It is crucial for developers to update the package to the latest version to ensure the security and integrity of cryptographic operations. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for node-forge →

Share this vulnerability

FAQ

node-forge is an npm package that provides cryptographic utilities for JavaScript, allowing developers to perform encryption, decryption, digital signatures, and certificate management in their applications.

Prototype Pollution is a vulnerability that occurs when an attacker can modify the prototype of an object, leading to unexpected behavior or security breaches.

The vulnerability in node-forge can potentially allow an attacker to compromise the integrity and confidentiality of cryptographic operations performed by the package.

To fix this vulnerability, it is recommended to update the node-forge package to version 0.10.0 or later.

Yes, developers can manually modify the affected function in their code to mitigate the vulnerability. See the 'workaround' section for an example.

Related vulnerabilities

Recent vulnerabilities recorded for node-forge.

How To Fix

Latest published version: 1.4.0 as of 22 Oct 2026

npm install node-forge@1.4.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.10.0

This is the first release that contains the fix.

npm install node-forge@0.10.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback