{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-107377","id":"CVE-2026-107377","title":"datamodel-code-generator: Protobuf weak-import path traversal allows files to be written outside the temporary directory","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","descriptionLong":"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.","published":"2026-10-08T17:55:22.595Z","updated":"2026-10-28T02:31:00.261847970Z","reserved":"2026-10-07T21:07:54.987Z","status":"Deferred","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","rating":"high","source":"GitHub_M"},"metrics":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","rating":"high","source":"GitHub_M"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","rating":"high","source":"github.com"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","rating":"high","source":"OSV"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","rating":"high","source":"GitHub"}],"rating":"high","products":["datamodel-code-generator"],"affectedProducts":[{"vendor":"datamodel-code-generator","product":"datamodel-code-generator","defaultStatus":null,"versions":[{"version":">= 0.59.0, < 0.81.0","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"PyPI","name":"datamodel-code-generator","purl":"pkg:pypi/datamodel-code-generator","ranges":[">=0.59.0 <0.81.0"],"fixed":["0.81.0"],"advisory":"GHSA-77xj-x4rm-935c"}],"cwes":["CWE-22","CWE-73"],"aliases":["GHSA-77xj-x4rm-935c","PYSEC-2026-4205"],"references":[{"url":"https://github.com/datamodel-code-generator/datamodel-code-generator/security/advisories/GHSA-77xj-x4rm-935c","tags":["x_refsource_CONFIRM","exploit","advisory","web"]},{"url":"https://github.com/datamodel-code-generator/datamodel-code-generator/commit/5e94b8f4203198798ec66b8e48217f70af69a0dc","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/datamodel-code-generator/datamodel-code-generator/releases/tag/0.81.0","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/107xxx/CVE-2026-107377.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-107377","tags":["advisory"]},{"url":"https://github.com/datamodel-code-generator/datamodel-code-generator","tags":["package"]},{"url":"https://pypi.org/project/datamodel-code-generator","tags":["package"]},{"url":"https://github.com/advisories/GHSA-77xj-x4rm-935c","tags":["advisory"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial"},"epss":0.00535,"epssPercentile":0.46066,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-107377","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-107377","ok":true,"note":"Deferred"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-107377","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-77xj-x4rm-935c","ok":true,"note":"GHSA-77xj-x4rm-935c"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-107377","ok":true,"note":"scored 2026-11-20"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}