{"id":"UBUNTU-CVE-2026-107377","details":"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.","modified":"2026-10-14T03:22:47.537609772Z","published":"2026-10-13T00:00:00Z","upstream":["CVE-2026-107377"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2026-107377"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2026-107377"},{"type":"REPORT","url":"https://github.com/datamodel-code-generator/datamodel-code-generator/commit/5e94b8f4203198798ec66b8e48217f70af69a0dc"},{"type":"REPORT","url":"https://github.com/datamodel-code-generator/datamodel-code-generator/releases/tag/0.81.0"},{"type":"REPORT","url":"https://github.com/datamodel-code-generator/datamodel-code-generator/security/advisories/GHSA-77xj-x4rm-935c"}],"affected":[{"package":{"name":"python-datamodel-code-generator","ecosystem":"Ubuntu:26.04:LTS","purl":"pkg:deb/ubuntu/python-datamodel-code-generator?arch=source&distro=resolute"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.26.4-3","0.45.0-1"],"ecosystem_specific":{"binaries":[{"binary_name":"datamodel-codegen","binary_version":"0.45.0-1"},{"binary_version":"0.45.0-1","binary_name":"python3-datamodel-code-generator"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-107377.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"},{"type":"Ubuntu","score":"medium"}]}