# GHSA-8j6j-4h2c-c65p: Arbitrary Code Execution in require-node

> Attackers can execute arbitrary OS commands on the server by injecting malicious payloads into the require-node endpoint request body.

- **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:** 3 Sep 2020

## What is GHSA-8j6j-4h2c-c65p?

GHSA-8j6j-4h2c-c65p is a command injection vulnerability in require-node, published on 3 Sep 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Versions of `require-node` prior to 1.3.4 for 1.x and 2.0.4 for 2.x are vulnerable to Arbitrary Code Execution. The package fails to sanitize requests to the `require-node` endpoint, allowing attackers to execute arbitrary code in the server through the injection of OS commands in the request body.

## Recommendation

- If you are using 1.x, upgrade to version 1.3.4 or later.
- If you are using 2.x, upgrade to version 2.0.4 or later.

## Which versions are affected by GHSA-8j6j-4h2c-c65p?

4 open source packages ship an affected version, including require-node.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `require-node` | npm | All versions | 1.3.4 |
| `require-node` | npm | All versions | 1.3.4 |
| `require-node` | npm | From 2.0.0 | 2.0.4 |
| `require-node` | npm | From 2.0.0 | 2.0.4 |

## How do I fix GHSA-8j6j-4h2c-c65p?

Upgrade require-node to a fixed version for your release line: 1.3.4 or 2.0.4.

## Is GHSA-8j6j-4h2c-c65p being exploited?

There is no known exploitation of GHSA-8j6j-4h2c-c65p in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-8j6j-4h2c-c65p and fix it if it is affected.

What it is: GHSA-8j6j-4h2c-c65p is a command injection vulnerability in require-node, published on 3 Sep 2020. 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-8j6j-4h2c-c65p in the wild and no public exploit code.

Affected packages and fixed versions:
- require-node (npm): affected all versions; fixed in 1.3.4
- require-node (npm): affected all versions; fixed in 1.3.4
- require-node (npm): affected from 2.0.0; fixed in 2.0.4
- require-node (npm): affected from 2.0.0; fixed in 2.0.4

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-8j6j-4h2c-c65p/ (Markdown: https://insights.sbomify.com/GHSA-8j6j-4h2c-c65p/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-8j6j-4h2c-c65p

---
From sbomify Insights: https://insights.sbomify.com/GHSA-8j6j-4h2c-c65p/
Summaries are generated and may contain mistakes; the official description above is the record.
