# GHSA-5rrq-pxf6-6jx5: Prototype Pollution in node-forge debug API.

> Prototype pollution in the undocumented debug API of node-forge allows attackers to manipulate object prototypes if untrusted input is processed.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 8 Jan 2022

## What is GHSA-5rrq-pxf6-6jx5?

GHSA-5rrq-pxf6-6jx5 is a vulnerability in node-forge, published on 8 Jan 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### 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:
* Open an issue in [forge](https://github.com/digitalbazaar/forge).
* Email us at support@digitalbazaar.com.

## Which versions are affected by GHSA-5rrq-pxf6-6jx5?

2 open source packages ship an affected version, including node-forge.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `node-forge` | npm | All versions | 1.0.0 |
| `node-forge` | npm | All versions | 1.0.0 |

## How do I fix GHSA-5rrq-pxf6-6jx5?

Upgrade node-forge to 1.0.0 or later.

## Is GHSA-5rrq-pxf6-6jx5 being exploited?

There is no known exploitation of GHSA-5rrq-pxf6-6jx5 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-5rrq-pxf6-6jx5 and fix it if it is affected.

What it is: GHSA-5rrq-pxf6-6jx5 is a vulnerability in node-forge, published on 8 Jan 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-5rrq-pxf6-6jx5 in the wild and no public exploit code.

Affected packages and fixed versions:
- node-forge (npm): affected all versions; fixed in 1.0.0
- node-forge (npm): affected all versions; fixed in 1.0.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-5rrq-pxf6-6jx5/ (Markdown: https://insights.sbomify.com/GHSA-5rrq-pxf6-6jx5/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-5rrq-pxf6-6jx5

---
From sbomify Insights: https://insights.sbomify.com/GHSA-5rrq-pxf6-6jx5/
Summaries are generated and may contain mistakes; the official description above is the record.
