CVE-2026-137999

JSONSchema2PoPo2 through 3.0.3 Code Injection via python_class.tmpl Template

Published Nov 27, 2026 CVSS 4.0 · 8.5 High EPSS n/a KEV · Not listed
Description
JSONSchema2PoPo2 through 3.0.3 contains a code injection vulnerability that allows attackers to inject Python code by supplying JSON Schema default or format values that are written unescaped. Attackers can place a single quote in a string property default to break out of the literal in the generated __init__ signature, executing injected code when the generated module is imported.

Analysis

AI-generated

Technical impact

JSONSchema2PoPo2 includes a code injection flaw that permits arbitrary Python code to be injected by supplying malicious default or format values in a JSON Schema. The vulnerable template writes these values directly into the generated __init__ method signature without escaping. When an attacker supplies a single quote, the literal is broken and the injected code is executed during import of the generated module, giving the attacker full control over the host process.

Affected Systems

The vulnerability affects the MikeDombo:JSONSchema2PoPo2 project, versions up to and including 3.0.3. No other versions or products are listed as affected.

Risk and Exploitability

The CVSS score of 8.5 indicates high severity. The EPSS score is not available, so exploitation probability cannot be quantified. The issue is not listed in the CISA KEV catalog. Attackers can exploit the flaw by crafting a JSON Schema with malicious defaults or formats that, when processed by JSONSchema2PoPo2, generate a module containing injected code. The module must then be imported in a trusted environment for the payload to execute.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to JSONSchema2PoPo2 version 3.0.4 or later once the fix is released
  • Apply a local patch to python_class.tmpl to escape all default and format values before inserting them into the code
  • Validate or sanitize all incoming JSON Schema defaults and formats to ensure they contain only permitted literals, and restrict imports of generated modules to trusted code

Generated by OpenCVE AI on November 27, 2026 at 17:53 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Mikedombo
Mikedombo jsonschema2popo2
Vendors & Products Mikedombo
Mikedombo jsonschema2popo2
Type Values Removed Values Added
Description JSONSchema2PoPo2 through 3.0.3 contains a code injection vulnerability that allows attackers to inject Python code by supplying JSON Schema default or format values that are written unescaped. Attackers can place a single quote in a string property default to break out of the literal in the generated __init__ signature, executing injected code when the generated module is imported.
Title JSONSchema2PoPo2 through 3.0.3 Code Injection via python_class.tmpl Template
Weaknesses CWE-94
References
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.5, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Nov 27, 2026, 4:10 PM
Reserved
Nov 27, 2026, 3:59 PM
Status
Received
Published
Nov 27, 2026, 5:17 PM
Modified
Nov 27, 2026, 5:17 PM