# CVE-2021-4329: json-logic-js logic.js command injection


- **Severity:** Medium 5.5 (`CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 5 Mar 2023
- **Updated:** 5 Mar 2025
- **Also known as:** GHSA-67j4-2mh6-8627

## What is CVE-2021-4329?

CVE-2021-4329 is a medium-severity vulnerability in json-logic-js, published on 5 Mar 2023. 

### Official description

A vulnerability, which was classified as critical, has been found in json-logic-js 2.0.0. Affected by this issue is some unknown functionality of the file logic.js. The manipulation leads to command injection. Upgrading to version 2.0.1 is able to address this issue. The patch is identified as c1dd82f5b15d8a553bb7a0cfa841ab8a11a9c227. It is recommended to upgrade the affected component. VDB-222266 is the identifier assigned to this vulnerability.

Weakness: CWE-77 (Improper Neutralization of Special Elements used in a Command)

## Which versions are affected by CVE-2021-4329?

2 open source packages ship an affected version, including json-logic-js. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `json-logic-js` | npm | All versions | 2.0.1 |
| `json-logic-js` | npm | All versions | 2.0.1 |

Products: Json-Logic-Js Project Json-Logic-Js.

## How do I fix CVE-2021-4329?

Upgrade json-logic-js to 2.0.1 or later.

## Is CVE-2021-4329 being exploited?

There is no known exploitation of CVE-2021-4329 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-4329 and fix it if it is affected.

What it is: CVE-2021-4329 is a medium-severity vulnerability in json-logic-js, published on 5 Mar 2023. 
Exploitation: There is no known exploitation of CVE-2021-4329 in the wild and no public exploit code.

Affected packages and fixed versions:
- json-logic-js (npm): affected all versions; fixed in 2.0.1
- json-logic-js (npm): affected all versions; fixed in 2.0.1

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/CVE-2021-4329/ (Markdown: https://insights.sbomify.com/CVE-2021-4329/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-4329
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-4329
- OSV: https://osv.dev/vulnerability/CVE-2021-4329

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-4329/
Summaries are generated and may contain mistakes; the official description above is the record.
