Critical Command Injection Vulnerability in json-logic-js 2.0.0

json-logic Updated 02 Oct 2025

Summary

05/03/2023
N/A
Yes i
Critical
9.8

PYSEC-2023-209: A vulnerability, which was classified as critical, has been found in json-logic-js 2.0.0. Affects json-logic versions < c1dd82f5b15d8a553bb7a0cfa841ab8a11a9c227. Fixed in c1dd82f5b15d8a553bb7a0cfa841ab8a11a9c227. How to fix ↓

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

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

json-logic-js is an open-source library available on PyPI that provides functionality for working with JSON-based rules. It is commonly used for evaluating and executing logical rules expressed in JSON format. The library is vulnerable to a critical command injection vulnerability in the logic.js file. This vulnerability allows an attacker to manipulate the logic and execute arbitrary commands. The vulnerability has been assigned the identifier CVE-2021-4329 and has a CVSS score of 9.8.

Vulnerability Detail

The command injection vulnerability in json-logic-js 2.0.0 arises due to insufficient input validation and sanitization. An attacker can exploit this vulnerability by crafting malicious JSON logic that includes arbitrary commands. When the logic is evaluated, the commands are executed within the context of the application, leading to potential remote code execution or unauthorized access to sensitive information. This vulnerability poses a significant risk to applications utilizing the affected version of json-logic-js.

How To Fix

Latest published version: 0.6.3 as of 22 Oct 2026

pip install --upgrade "json-logic==0.6.3"

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

If you need the minimum change

c1dd82f5b15d8a553bb7a0cfa841ab8a11a9c227

This is the first release that contains the fix.

pip install --upgrade "json-logic==c1dd82f5b15d8a553bb7a0cfa841ab8a11a9c227"

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

Workaround

As a temporary workaround, developers can implement strict input validation and sanitization when processing JSON logic. This includes thoroughly validating and filtering any user-supplied input to prevent the injection of malicious commands. Here is an example of how input validation can be performed in Python:

import json

def validate_json_logic(json_logic):
    try:
        json.loads(json_logic)
        return True
    except ValueError:
        return False

Conclusion

The command injection vulnerability in json-logic-js 2.0.0 poses a significant risk to applications utilizing this version. It is crucial to upgrade to version 2.0.1 or apply the provided workaround to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for json-logic →

Share this vulnerability

FAQ

json-logic-js is an open-source library that provides functionality for working with JSON-based rules. It allows developers to evaluate and execute logical rules expressed in JSON format.

This vulnerability allows an attacker to execute arbitrary commands within the context of the application. This can lead to remote code execution or unauthorized access to sensitive information.

To fix this vulnerability, it is recommended to upgrade the json-logic-js package to version 2.0.1. This version includes a patch that addresses the command injection vulnerability.

As a temporary workaround, you can implement strict input validation and sanitization when processing JSON logic. This can help prevent the injection of malicious commands.

The CVSS score of this vulnerability is 9.8, indicating its critical severity.

How To Fix

Latest published version: 0.6.3 as of 22 Oct 2026

pip install --upgrade "json-logic==0.6.3"

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

If you need the minimum change

c1dd82f5b15d8a553bb7a0cfa841ab8a11a9c227

This is the first release that contains the fix.

pip install --upgrade "json-logic==c1dd82f5b15d8a553bb7a0cfa841ab8a11a9c227"

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