{"answers":{"affected":"3 open source packages ship an affected version, including datamodel-code-generator.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-107377 exists.","fix":"Upgrade datamodel-code-generator to 0.81.0 or later.","what":"CVE-2026-107377 is a high-severity path traversal vulnerability in datamodel-code-generator, published on 8 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-107377 and fix it if it is affected.\n\nWhat it is: CVE-2026-107377 is a high-severity path traversal vulnerability in datamodel-code-generator, published on 8 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-107377 exists.\n\nAffected packages and fixed versions:\n- datamodel-code-generator (PyPI): affected from 0.59.0; fixed in 0.81.0\n- datamodel-code-generator (PyPI): affected from 0.59.0; fixed in 0.81.0\n- datamodel-code-generator (PyPI): affected from 0.59.0; fixed in 0.81.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-107377/ (Markdown: https://insights.sbomify.com/CVE-2026-107377/index.md)","id":"CVE-2026-107377","markdown":"https://insights.sbomify.com/CVE-2026-107377/index.md","name":"CVE-2026-107377","record":{"aliases":["ECHO-b8c0-0024-5488","GHSA-77xj-x4rm-935c","PYSEC-2026-4205","UBUNTU-CVE-2026-107377","openSUSE-SU-2026:12096-1"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["data_modify"],"network_reachable":"yes","non_default_config":true,"product_category":"Python code generator","requires_auth":"none","summary":"Attacker-controlled Protobuf schemas can write files outside the temporary directory, potentially overwriting existing files with syntax declarations.","user_interaction":"not_required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":7.5,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-73","name":"External Control of File Name or Path"},{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted 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 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.","ecosystems":["PyPI","openSUSE:Tumbleweed"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"datamodel-code-generator: Protobuf weak-import path traversal allows files to be written outside the temporary directory","id":"CVE-2026-107377","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"path_traversal","year":"2026"},"n_packages":4,"n_references":3,"next":{"headline":"CairoSVG: Quadratic-time DoS parsing a crafted SVG \u003cpath\u003e","id":"CVE-2026-107378"},"packages":[{"ecosystem":"PyPI","fixed":["0.81.0"],"introduced":["0.59.0"],"last_affected":[],"package":"datamodel-code-generator","purl":null,"source":"GHSA-77xj-x4rm-935c"},{"ecosystem":"PyPI","fixed":["0.81.0"],"introduced":["0.59.0"],"last_affected":[],"package":"datamodel-code-generator","purl":"pkg:pypi/datamodel-code-generator","source":"GHSA-77xj-x4rm-935c"},{"ecosystem":"PyPI","fixed":["0.81.0"],"introduced":["0.59.0"],"last_affected":[],"package":"datamodel-code-generator","purl":"pkg:pypi/datamodel-code-generator","source":"PYSEC-2026-4205"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["0.83.0-1.1"],"introduced":["0"],"last_affected":[],"package":"python-datamodel-code-generator","purl":"pkg:rpm/opensuse/python-datamodel-code-generator\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2026:12096-1"}],"prev":{"headline":"webonyx graphql-php: Unbounded recursion in parser causes stack overflow on crafted nested input","id":"CVE-2026-107376"},"products":["datamodel-code-generator"],"published":"2026-10-08","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"openSUSE"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-10-14","vendors":["datamodel-code-generator"]},"summary":"Attacker-controlled Protobuf schemas can write files outside the temporary directory, potentially overwriting existing files with syntax declarations.","url":"https://insights.sbomify.com/CVE-2026-107377/"}