CVE-2026-19964
Jij-MCP-Server is vulnerable to remote code injection in PythonREPL.run.
- CVSS 2.0
- 74
- Input Validation and Sanitization
- Remote
A vulnerability was found in Jij-Inc Jij-MCP-Server 0.1.0. This affects the function PythonREPL.run of the file jij_mcp/python_repr.py of the component jm_check. The manipulation of the argument code results in code injection. It is possible to launch the attack remotely. The exploit has been made public and could be used. The project was informed of the problem early through an issue report but has not responded yet.
- CWE
- 74
- CVSS base score
- 2.0
- Published
- 2026-08-17
- OWASP
- A03 Injection
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Command Injection
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Fixed by upgrading
- Yes
Solution
No patch is available. It is recommended to disable the `jm_check` component or discontinue use until a fix is released.
Vulnerable code sample
import sys
from io import StringIO
from typing import Any
# Placeholder for the external 'pb' module and its 'CheckResult' class
pb = type("pb", (), {"CheckResult": lambda **kwargs: None})
class PythonREPL:
def __init__(self, globals: dict | None = None, locals: dict | None = None):
self._globals = globals if globals is not None else {}
self._locals = locals if locals is not None else {}
def run(self, code: str) -> pb.CheckResult:
old_stdout = sys.stdout
sys.stdout = mystdout = StringIO()
old_stderr = sys.stderr
sys.stderr = mystderr = StringIO()
try:
# VULNERABLE: User-provided 'code' is executed with exec(), leading to code injection.
exec(code, self._globals, self._locals)
except Exception:
pass
finally:
sys.stdout = old_stdout
sys.stderr = old_stderr
return pb.CheckResult(
stdout=mystdout.getvalue(),
stderr=mystderr.getvalue(),
)Patched code sample
import sys
from io import StringIO
from typing import Any
from RestrictedPython import compile_restricted, safe_builtins
# Placeholder for the external 'pb' module and its 'CheckResult' class
pb = type("pb", (), {"CheckResult": lambda **kwargs: None})
class PythonREPL:
def __init__(self, globals: dict | None = None, locals: dict | None = None):
self._globals = globals if globals is not None else {}
self._locals = locals if locals is not None else {}
def run(self, code: str) -> pb.CheckResult:
old_stdout = sys.stdout
sys.stdout = mystdout = StringIO()
old_stderr = sys.stderr
sys.stderr = mystderr = StringIO()
try:
# FIX: Compile the code in a restricted environment to prevent execution of malicious code.
byte_code = compile_restricted(code, "<string>", "exec")
safe_globals = {"__builtins__": safe_builtins}
exec(byte_code, safe_globals, self._locals)
except Exception:
pass
finally:
sys.stdout = old_stdout
sys.stderr = old_stderr
return pb.CheckResult(
stdout=mystdout.getvalue(),
stderr=mystderr.getvalue(),
)Payload
import os; os.system('id')
Cite this entry
@misc{vaitp:cve202619964,
title = {{Jij-MCP-Server is vulnerable to remote code injection in PythonREPL.run.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-19964},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-19964/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
