Skip to main content

datamodel-code-generator: Protobuf weak-import path traversal allows files to be written outside the temporary directory (CVE-2026-107377)

0
High
Published: 10/08/2026 (10/08/2026, 17:58:01 UTC)
Source: GCVE Database
Product: datamodel-code-generator

Description

A path traversal vulnerability in datamodel-code-generator versions >=0.59.0 and <0.81.0 allows attacker-controlled Protobuf schemas to write files outside the intended temporary directory. The vulnerability arises from improper handling of absolute and relative import paths in weak-import stubs, enabling creation or overwriting of files in writable locations. The written content is limited to a fixed Protobuf syntax declaration, and no direct arbitrary code execution has been demonstrated. The issue occurs before the Protobuf compiler runs and is triggered when processing attacker-controlled schemas via local files or URLs. A fix has been merged but no patched package release is yet available.

CVSS v3.1

Score 7.5high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Affected software

PyPIghsa
datamodel-code-generator
Affected versions
>=0.59.0 <0.81.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/08/2026, 22:10:30 UTC

Technical Analysis

The datamodel-code-generator tool, when processing Protobuf schemas with weak imports, fails to properly validate import paths. Specifically, absolute paths or relative paths containing '..' can escape the designated '__weak_imports__' temporary directory. This allows an attacker supplying a malicious schema to cause the tool to create directories and write files at arbitrary writable locations on the filesystem. The written files contain only a fixed Protobuf syntax declaration line. The vulnerability affects versions >=0.59.0 and <0.81.0. The issue is triggered before the Protobuf compiler runs and requires the victim to run the tool on the attacker-controlled schema. A patch has been merged into the main branch but no official release with the fix is available yet.

Potential Impact

An attacker can cause the tool to write files outside the intended temporary directory, potentially creating new directories and overwriting existing writable files. While the file contents are limited and do not allow direct arbitrary code execution, the integrity of files can be compromised. This could disrupt build processes or cause other integrity-related issues. The vulnerability does not impact confidentiality or availability directly but poses a high integrity risk.

Mitigation Recommendations

A fix has been merged into the main branch of the datamodel-code-generator repository. Users should update to a patched version once it is officially released. Until then, avoid processing untrusted Protobuf schemas with the affected versions (>=0.59.0 <0.81.0). The vendor advisory confirms a patch is available but no release yet. No alternative mitigations are provided.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-77xj-x4rm-935c
Osv Schema Version
1.4.0
Aliases
["CVE-2026-107377"]
Ecosystems
["PyPI"]
Database Specific Severity
HIGH
Cvss Version
3.1

Threat ID: 6ac80fb42cdf04f65639a8a9

Added to database: 10/08/2026, 21:48:36 UTC

Last enriched: 10/08/2026, 22:10:30 UTC

Last updated: 10/08/2026, 22:10:30 UTC

Views: 6

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses