{"cve":"CVE-2026-107377","nvd":{"published":"2026-10-08T18:17:22.973","modified":"2026-10-14T02:16:56.650","status":"Deferred","description":"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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5},"cwes":["CWE-22","CWE-73"],"references":["https://github.com/datamodel-code-generator/datamodel-code-generator/commit/5e94b8f4203198798ec66b8e48217f70af69a0dc","https://github.com/datamodel-code-generator/datamodel-code-generator/releases/tag/0.81.0","https://github.com/datamodel-code-generator/datamodel-code-generator/security/advisories/GHSA-77xj-x4rm-935c","https://github.com/datamodel-code-generator/datamodel-code-generator/security/advisories/GHSA-77xj-x4rm-935c"],"products":[],"source":"nvd","synced_at":"2026-10-19T22:58:01.639778232+00:00"},"epss":{"cve":"CVE-2026-107377","score":0.00535,"percentile":0.44849,"date":"2026-10-25"},"kev":null,"osv":[{"id":"GHSA-77xj-x4rm-935c","url":"https://osv.dev/vulnerability/GHSA-77xj-x4rm-935c","summary":"datamodel-code-generator: Protobuf weak-import path traversal allows files to be written outside the temporary directory","modified":"2026-10-15T14:56:05.150508640Z","packages":[{"ecosystem":"PyPI","name":"datamodel-code-generator","purl":"pkg:pypi/datamodel-code-generator","ranges":[">=0.59.0 <0.81.0"],"fixed":["0.81.0"]}]},{"id":"PYSEC-2026-4205","url":"https://osv.dev/vulnerability/PYSEC-2026-4205","summary":"datamodel-code-generator: Protobuf weak-import path traversal allows files to be written outside the temporary directory","modified":"2026-10-15T14:45:04.400608742Z","packages":[{"ecosystem":"PyPI","name":"datamodel-code-generator","purl":"pkg:pypi/datamodel-code-generator","ranges":[">=0.59.0 <0.81.0"],"fixed":["0.81.0"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}