CVE-2026-107377 json
datamodel-code-generator: Protobuf weak-import path traversal allows files to be written outside the temporary directory
published last mo. modified 25d ago also GHSA-77xj-x4rm-935c , PYSEC-2026-4205 , EUVD-2026-95134
- cvss
- 7.5
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.5%
- EPSS 0.5% chance of exploitation in 30 days, percentile 45%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi datamodel-code-generator 0.81.0
- python-datamodel-code-generator openSUSE Tumbleweed 0.83.0-1.1
opensuse advisories openSUSE-SU-2026:12096-1
Is CVE-2026-107377 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerCISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- yes
- Technical impact
- partial
- Assessed
- 27d ago
Exploit prediction
0.54% chance of exploitation in the next 30 days, higher than 45% of all scored CVEs (FIRST EPSS, 2026-11-09).
Exploits and checks
- github.com https://github.com/datamodel-code-generator/datamodel-code-generator/security/advisories/GHSA-77xj-x4rm-935c referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| OSV | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| GitHub | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | datamodel-code-generator | >=0.59.0, <0.81.0 |
0.81.0 |
Affected products
- datamodel-code-generator datamodel-code-generator
Classification
References
-
github.com
/datamodel-code-generator/datamodel-code-generator/commit/5e94b8f4203198798ec66b8e48217f70af69a0dc
web
-
github.com
/datamodel-code-generator/datamodel-code-generator/security/advisories/GHSA-77xj-x4rm-935c
exploit, web
-
github.com
/datamodel-code-generator/datamodel-code-generator/releases/tag/0.81.0
web
-
github.com
/datamodel-code-generator/datamodel-code-generator
package
-
pypi.org
/project/datamodel-code-generator
package
-
github.com
/advisories/GHSA-77xj-x4rm-935c
advisory
-
nvd.nist.gov
/vuln/detail/CVE-2026-107377
advisory
Sources
- CVE List CVE-2026-107377
- GitHub Advisory GHSA-77xj-x4rm-935c
- NVD CVE-2026-107377
- OSV PYSEC-2026-4205
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.