All CVEs / datamodel-code-generator
CVE-2026-107377datamodel-code-generator
High 7.5 No auth needed
Follow: this CVE · datamodel-code-generator · datamodel-code-generator We alert you by email or Slack (account required).
- Priority
- 60
- CVSS 3.1
- 7.5
- EPSS
- —
- Auth required
- No
- Published
- Oct 8, 2026
- Updated
- Oct 14, 2026
- Category
- Application · Cross-platform
- 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.
What to do
- Apply the vendor's security update for datamodel-code-generator.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How 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
- datamodel-code-generator · datamodel-code-generator
As reported by the CNA that published the CVE. NVD has not added CPEs with versions yet.
Official advisories
- python313-datamodel-code-generator-0.83.0-1.1 on GA media · SUSE · openSUSE-SU-2026:12096-1 · Oct 9, 2026 High
Vendor, CERT and distribution advisories that name this CVE. Original titles.
Official sources
References
Links published by the sources. Open them with care.