CVE-2026-137999: JSONSchema2PoPo2 through 3.0.3 Code Injection via python_class.tmpl Template
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.
Affected Software
Event History
Frequently Asked Questions
Which deployments are most exposed?
Deployments that generate Python modules from JSON Schemas supplied by untrusted or externally controlled parties are exposed. The injected code executes when the generated module is imported.
What does an attacker need to do to trigger the issue?
The attacker needs to supply a JSON Schema containing an injection payload in a default or format value. A single quote in a string-property default can break out of the generated __init__ signature and inject Python code.
How can I identify potentially affected generated code?
Review use of JSONSchema2PoPo2 through version 3.0.3 and identify modules generated from schemas with externally controlled default or format values. Generated modules that are subsequently imported are the relevant execution point.