PatchSiren

PatchSiren cyber security CVE debrief

CVE-2026-107377 datamodel-code-generator CVE debrief

A vulnerability in `datamodel-code-generator` allows an attacker to write files outside the intended temporary directory when processing an attacker-controlled Protobuf schema. This could lead to the creation of directories and files at locations writable by the process, potentially overwriting existing files. The vulnerability is caused by a weak-import path traversal issue in `datamodel-code-generator`. An attacker-controlled Protobuf schema can be used to write a generated weak-import stub outside the intended `__weak_imports__` temporary directory. Absolute import paths and relative paths containing `..` could escape this directory. Users of `datamodel-code-generator` library,

Vendor
datamodel-code-generator
Product
Unknown
CVSS
HIGH 7.5
CISA KEV
Not listed in stored evidence
Original CVE published
2026-10-08
Original CVE updated
2026-10-08
Advisory published
2026-10-08
Advisory updated
2026-10-08

Who should care

Users of `datamodel-code-generator` library, especially those processing attacker-controlled Protobuf schemas, should assess their exposure and update to version 0.81.0 or later. This includes operators, platform administrators, vulnerability management teams, and security teams who need to review the affected scope, severity, and vendor guidance.

Why it matters

A vulnerability in `datamodel-code-generator` allows an attacker to write files outside the intended temporary directory when processing an attacker-controlled Protobuf schema. This could lead to the creation of directories and files at locations writable by the process, potentially overwriting existing files. Users should assess their exposure and update to version 0.81.0 or later.

  • Potential for unauthorized file creation and modification
  • Possible overwriting of existing files
  • Filesystem side effects before `protoc` compilation

Technical summary

The `datamodel-code-generator` library is vulnerable to a path traversal attack when processing Protobuf schemas. An attacker could create directories and files outside the intended temporary directory, potentially overwriting existing files. The vulnerability is caused by a weak-import path traversal issue in `datamodel-code-generator`. An attacker-controlled Protobuf schema can be used to write a generated weak-import stub outside the intended `__weak_imports__` temporary directory. Absolute import paths and relative paths containing `..` could escape this directory. This issue did not provide fully attacker-controlled file contents, and direct arbitrary code execution has not been demonstrated.

Defensive priority

High

Recommended defensive actions

  • Assess exposure of `datamodel-code-generator` usage in your environment
  • Verify if vulnerable versions are in use and update to version 0.81.0 or later
  • Monitor for potential file system side effects
  • Review compensating controls for exposed systems while remediation is scheduled and verified
  • Check relevant monitoring, detection, and logs for exposed assets that need extra review
  • Track exceptions, retest remediated assets, and close the item only after evidence is documented
  • Confirm whether affected product deployments exist in managed environments and assign an owner for follow-up

Evidence notes

The vulnerability is caused by a weak-import path traversal issue in `datamodel-code-generator`. An attacker-controlled Protobuf schema can be used to write a generated weak-import stub outside the intended `__weak_imports__` temporary directory. Absolute import paths and relative paths containing `..` could escape this directory.

Sources and references

Verified primary and authoritative sources

  • CVE-2026-107377 CVE Program record

    Publisher, destination, and source semantics verified

    URL: https://www.cve.org/CVERecord?id=CVE-2026-107377

    CVE Program - Official CVE Program record with source-provided CVE metadata.

  • CVE-2026-107377 NVD vulnerability detail

    Publisher, destination, and source semantics verified

    URL: https://nvd.nist.gov/vuln/detail/CVE-2026-107377

    NIST National Vulnerability Database - Official NIST NVD detail page and source-specific vulnerability assessment.

Supplemental references

  • datamodel-code-generator: Protobuf weak-import path traversal allows files to be written outside

    Unverified legacy reference

    URL: https://storage.googleapis.com/osv-vulnerabilities/PyPI/GHSA-77xj-x4rm-935c.json

    osv_dev

  • Source reference

    Unverified legacy reference

    URL: https://github.com/datamodel-code-generator/datamodel-code-generator/security/advisories/GHSA-77xj-x4rm-935c

    Supplemental source

  • Source reference

    Unverified legacy reference

    URL: https://github.com/datamodel-code-generator/datamodel-code-generator/commit/5e94b8f4203198798ec66b8e48217f70af69a0dc

    Supplemental source

  • Source reference

    Unverified legacy reference

    URL: https://github.com/datamodel-code-generator/datamodel-code-generator

    Supplemental source

  • Source reference

    Unverified legacy reference

    URL: https://github.com/datamodel-code-generator/datamodel-code-generator/releases/tag/0.81.0

    Supplemental source

Methodology and review provenance

AI-assisted synthesis based on stored public vulnerability evidence. System validation, approval state, and publication status do not by themselves establish human review of this revision. PatchSiren helps prioritize defensive review and does not prove exposure or remediation on any system.