Live threats

All CVEs / datamodel-code-generator

CVE-2026-107377datamodel-code-generator

High 7.5 No auth needed

Priority
60
CVSS 3.1
7.5
EPSS
—
Auth required
No
Published
Oct 8, 2026
Updated
Oct 14, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-22, CWE-73
SSVC (CISA)
Exploitation: proof of concept · Automatable: yes · Technical impact: partial
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

What happens

datamodel-code-generator generates Python data models from schema definitions. From 0.59.0 until 0.81.0, an attacker-controlled Protobuf schema can supply absolute or parent-directory paths captured by WEAK_IMPORT_PATTERN and consumed by _write_missing_weak_imports in src/datamodel_code_generator/parser/protobuf.py. Exploitation requires a victim or automated job to process the attacker-controlled schema with Protobuf input support, which requires the grpcio-tools package. The paths escape the weak_imports temporary directory before protoc runs, allowing creation of directory trees and new files or overwrite of existing writable files with a generated Protobuf syntax declaration. The effect persists when later Protobuf compilation fails. The written content is limited to a proto2 or proto3 syntax declaration, and direct arbitrary code execution has not been demonstrated. This issue is fixed in version 0.81.0.

Original NVD text.

What to do

  1. Apply the vendor's security update for datamodel-code-generator.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
PyPI datamodel-code-generator ≥ 0.59.0 < 0.81.0 0.81.0 pip install "datamodel-code-generator>=0.81.0"
PyPI datamodel-code-generator ≥ 0.59.0 < 0.81.0 0.81.0 pip install "datamodel-code-generator>=0.81.0"

Per OSV / GitHub Advisories (GHSA-77xj-x4rm-935c, PYSEC-2026-4205). Check the version in your lockfile before upgrading.

Affected products

As reported by the CNA that published the CVE. NVD has not added CPEs with versions yet.

Official advisories

Vendor, CERT and distribution advisories that name this CVE. Original titles.

Official sources

References

Links published by the sources. Open them with care.