Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSupply crafted JSON Schema with quoted default
-
ExploitVictim runs JSONSchema2PoPo2 generator
-
ExecutionSingle quote breaks __init__ string literal
-
ImpactInjected Python executes on module import
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires a developer to run the JSONSchema2PoPo2 code generator (version ≤3.0.3) against an attacker-controlled or otherwise untrusted JSON Schema in which a string property 'default' (or 'format') value is crafted to contain a single quote that breaks out of the generated Python __init__ literal, followed by importing the generated module. Limiting factors: this is a local/build-time vector (AV:L) that needs victim interaction (UI:P) - processing the malicious schema and importing the output - rather than a remotely reachable service; it affects the codegen workflow, not a deployed runtime, and only unpatched versions through 3.0.3 (fixed in 3.1.0). No special runtime configuration is required beyond using the vulnerable generator on untrusted schema input. |
| Impact | This is a genuine code-execution flaw (CWE-94) but the real-world risk is bounded and does not match a naive reading of the 8.5 score. The supplied CVSS 4.0 vector is 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 - critically AV:L (local attack vector) and UI:P (passive user interaction required), meaning this is NOT a remote, unauthenticated, zero-interaction network attack despite the high impact metrics (VC/VI/VA:H). Exploitation depends on a developer running the JSONSchema2PoPo2 generator (≤3.0.3) over an attacker-influenced JSON Schema and then importing the generated module, so it is a build-time / supply-chain-style code-injection rather than a runtime service compromise. Signals are consistent rather than conflicting: the vendor Decision label is 'this_week' (not act_now/emergency), there is no CISA KEV listing and no EPSS score in the input, and no confirmed working exploit code - only an issue, a patch PR, and a VulnCheck advisory. Net: a real, patchable priority for anyone who uses this library in a codegen pipeline, but low urgency for the general population because the product footprint is small and the attack requires local tooling plus victim interaction. Exploitation status: no public exploit identified at time of analysis. |
| Exploit ScenarioDerived | An attacker publishes or supplies a crafted JSON Schema whose string property 'default' (or 'format') value contains a single quote plus Python code; a developer runs JSONSchema2PoPo2 ≤3.0.3 to generate Python classes from it. Because the value is written unescaped into the generated __init__ signature, the injected code executes the moment the generated module is imported, achieving arbitrary code execution in the developer's/build environment. This requires local use of the generator and the victim to process the untrusted schema (AV:L, UI:P); no confirmed public exploit code is available, only the upstream issue and advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 27, 2026
Code injection in JSONSchema2PoPo2 through 3.0.3 lets a crafted JSON Schema smuggle Python statements into the generated class file, which execute when that generated module is imported. The root cause is CWE-94: schema-supplied values (string defaults, format, pattern, validations, enum values and descriptions) were pasted into the generated source unescaped, so a single quote inside a string property default breaks out of the literal in the generated __init__ signature; the same escaping gap affected the JavaScript and Go backends. Exposure is confined to the code generation workflow rather than a deployed service, since the flaw requires someone to run the generator against the malicious schema and then import the resulting module (CVSS 4.0 AV:L, UI:P, no privileges required); no public exploit code was identified at time of analysis and the issue is not in CISA KEV. Vendor-released patch: 3.1.0.
RemediationAI
Upgrade JSONSchema2PoPo2 to 3.1.0, the vendor-released patch that adds escaping filters and target-language identifier validation (pull request 25, commit cdb00f607a149f75b79a0f342b5881fd49ab4667, issue 24 at https://github.com/MikeDombo/JSONSchema2PoPo2/issues/24). Until the upgrade can be scheduled, the practical compensating control is to stop running the vulnerable generator on schemas from untrusted or third-party sources, or to generate only inside a disposable, network-isolated environment and to review the generated source before importing it; these reduce but do not eliminate risk, because a single overlooked single quote still yields executable code. Note that 3.1.0 deliberately skips validation for custom templates passed with -jt and for plugin-provided templates, so any pipeline using those still needs manual review of schema-derived values. The upgrade also carries behaviour changes worth testing first: string defaults on "type": "string" properties are now always emitted as strings in JavaScript (previously "5" became the number 5, "null" became null and a value like "pending" raised a ReferenceError at construction), schema values previously pasted in as code (non-string property defaults, keywords such as maximum, non-string enum values) are now emitted as strings unless they are numbers or plain names, and schema-derived type, property and enum names must be valid identifiers in the target language or generation halts with an error instead of producing broken code.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
JSONSchema2PoPo2 is a Python utility that converts JSON Schema documents into plain-old-Python-object classes, with additional backends that emit JavaScript and Go, all driven by Jinja templates (the Python backend via jsonschema2popo/python/python_class.tmpl, cited at line 70). Because the generator treated schema content as trusted text, values taken from the schema were interpolated straight into template output instead of being quoted or escaped: defaults of non-string properties, format and pattern strings, validation keywords such as maximum, enum values and descriptions could all terminate a string literal or a comment and let the remainder be parsed as code in the target language. That is a classic CWE-94 code injection surface, with the impact realized at build time - whoever consumes the generated module executes the injected statements at import. The 3.1.0 fix adds an is_identifier() check that rejects schema-derived type, property and enum names that are not valid identifiers in the target language, and introduces escaping filters (json_quote, json_value, json_literal) in the Python, JavaScript and Go templates. The changelog explicitly notes that custom templates supplied with -jt and plugin-provided templates are not covered by the new validation, so third-party templates retain the old interpolation behaviour.
Know when Jsonschema2Popo2 gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Local codegen vector (AV:L) requiring the victim to process an untrusted schema and import the output (UI:R); unescaped injection yields full code execution, so C/I/A:H and PR:N.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
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.
Articles & Coverage 1
Executive ViewAI
CVE-2026-137999 is a high-severity code injection vulnerability in JSONSchema2PoPo2 version 3.0.3 and earlier that allows a malicious JSON schema to embed Python statements into generated class files. This affects development teams using the tool to generate code, potentially leading to arbitrary code execution when the generated module is imported. Leadership should prioritize patching because the vulnerability enables code execution in developer environments, which could compromise build pipelines and intellectual property.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
EUVD-2026-137349
GHSA-qjhw-792c-66p4
NVD
CVE.org
EPSS
VulDB
Exploit-DB