Improper Verification of Cryptographic Signature in node-forge
Forge (also called `node-forge`) is a native implementation of Transport Layer Security in JavaScript. Prior to version 1.3.0, RSA PKCS#1 v1.5 signature verification code is lenient in checking the digest algorithm structure. This can allow a crafted structure that steals padding bytes and uses unchecked portion of the PKCS#1 encoded message to forge a signature when a low public exponent is being used. The issue has been addressed in `node-forge` version 1.3.0. There are currently no known workarounds.
### Impact
The `forge.debug` API had a potential prototype pollution issue if called with untrusted input. The API was only used for internal debug purposes in a safe way and never documented or advertised. It is suspected that uses of this API, if any exist, would likely not have used untrusted inputs in a vulnerable way.
### Patches
The `forge.debug` API and related functions were removed in 1.0.0.
### Workarounds
Don't use the `forge.debug` API directly or indirectly with untrusted input.
### References
- https://www.huntr.dev/bounties/1-npm-node-forge/
### For more information
If you have any questions or comments about this advisory
Prototype Pollution in node-forge util.setPath API
### Impact
`forge.util.setPath` had a potential prototype pollution issue if called with untrusted keys. This API was not used by forge itself.
### Patches
The `forge.util.setPath` API and related functions were removed in 0.10.0.
### Workarounds
Don't call `forge.util.setPath` directly or indirectly with untrusted keys.
### References
- https://security.snyk.io/vuln/SNYK-JS-NODEFORGE-598677
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7720
### For more information
If you have any questions or comments about this advisory:
* Open an issue in [forge](https://github.com/digitalbazaar/forge).
* Email us at support@digitalbazaar.
URL parsing in node-forge could lead to undesired behavior.
### Impact
The regex used for the `forge.util.parseUrl` API would not properly parse certain inputs resulting in a parsed data structure that could lead to undesired behavior.
### Patches
`forge.util.parseUrl` and other very old related URL APIs were removed in 1.0.0 in favor of letting applications use the more modern WHATWG URL Standard API.
### Workarounds
Ensure code does not directly or indirectly call `forge.util.parseUrl` with untrusted input.
### References
- https://www.huntr.dev/bounties/41852c50-3c6d-4703-8c55-4db27164a4ae/
### For more information
If you have any questions or comments about this advisory:
* Open an issue in [f
The package node-forge before 0.10.0 is vulnerable to Prototype Pollution via the util.setPath function. Note: Version 0.10.0 is a breaking change removing the vulnerable functions.