HOL LogoGuard

Explore HOL

  • HOL home
  • AI agent registry
  • AI plugins
  • Open standards
  • HOL members
  • Sponsor HOL
  • Advertise with HOL

Guard product

  • Guard overviewLocal security and control for AI agents and the tools they use.
  • FeaturesRuntime protection, policy routing, review, and evidence.

Explore Guard

  • Product previewWalk through Guard surfaces in read-only demo mode.
  • ComparisonCompare Guard with native controls and AI security vendors.

AI tools

  • All AI toolsEvery supported AI tool and how Guard applies policy to it.
  • Codex
  • Claude Code
  • Cursor
  • Antigravity CLI
  • OpenCode
  • Hermes
  • OpenClaw
  • GitHub Copilot CLI
  • Antigravity
  • Kimi
  • Grok
  • Pi / Oh My Pi
  • Zcode

Extensions

  • All extensionsBrowse command and MCP coverage with owners and stated limits.
  • Command coverageShell command protection across clouds, databases, backups, and packages.
  • MCP server coverageSee how Guard maps risk state across MCP tools and servers.
  • Core safetyThe safety floor listings that ship with Guard.
  • Data and resilienceBackup and storage command protection.
  • Cloud and infrastructureAWS, Azure, GCP, Kubernetes, and more.

Security

  • AI security hubSecurity research, advisories, and agent safety coverage.
  • AI tool securitySecurity profiles for each supported coding agent.
  • Safe labsHands-on attack simulations with safe boundaries.
  • Redacted warningsReal blocked actions with sensitive details removed.
  • AdvisoriesCoordinated disclosure reports for AI tooling.
  • Active CVEsSearch active CVEs affecting AI tooling.

Learn

  • Security guidesPractical guides for securing AI agent workflows.
  • DocsInstall, configure, and operate Guard with confidence.
  • ResearchPublished security research, benchmarks, and methodology.

Community

  • ReleasesVersion history, shipped changes and upgrade notes.
  • ContributorsThe people and contributions behind HOL Guard.
  • AffiliatesShare Guard with your audience and earn from referrals.
  • SponsorFund agreed research, implementation and shared testing through the HOL Partner Program.
  • AdvertiseCompare README logo placements, previews and monthly prices, or promote a plugin or extension.
PricingEnterpriseOpen AppInstall Guard
  1. Guard
  2. Security
  3. CVEs
  4. CVE 2026 54654 datamodel code generator vulnerable to code
HOL Guard

Public security guidance for teams protecting AI harnesses, MCP servers, skills, prompts, and local tool execution.

Install Guard

AI Security

  • Prompt injection
  • MCP security
  • OWASP MCP mapping
  • Supply chain

Resources

  • Trust packet
  • Harness setup
  • Redacted warnings
  • Safe labs

Product

  • Install Guard
  • Pricing
  • Open dashboard
Guard
  • Guard Overview
  • Releases
  • Contributors
  • Install Guard
  • Pricing
Docs
  • Documentation Index
  • Developer Hub
  • API Reference
  • Root OpenAPI
  • Registry OpenAPI
  • Run in Postman
  • Standards
  • Submit ERC-8004 Contract
  • Feature Your Agent
Best Plugins
  • Browse Plugins
  • Plugin Launches
  • Best Claude Plugins
  • Best Codex Plugins
  • Best Grok Plugins
  • Best Kimi Plugins
  • Best DeepSeek Plugins
  • Best Antigravity Plugins
  • Best MCP Servers
  • Best Cursor Plugins
  • Best OpenCode Plugins
Best Agents
  • Best ERC-8004 Agents
  • Best Virtuals Agents
  • Best MCP Servers
  • Best A2A Agents
  • Best x402 Payable
  • All Categories
Community
  • Telegram
  • X
More
  • About HOL
  • Sponsor
  • Advertise
  • Affiliate program
  • Contact
  • Blog
  • GitHub
  • Privacy
  • Terms of Service
Settings

Copyright © 2026 HOL DAO LLC. All rights reserved.

Back to active CVEs
High · CVSS 7.8CVE-2026-54654GHSA-WJV6-JCFJ-MF9R

`datamodel-code-generator` vulnerable to code injection via unescaped carriage return in `--extra-template-data` `comment` fieldCVE-2026-54654

Answer in brief

CVE-2026-54654 records a High severity (CVSS 7.8) vulnerability in `datamodel-code-generator` vulnerable to code injection via unescaped carriage return in `--extra-template-data` `comment` field. The current sources do not mark it as known exploited. The current feed maps datamodel-code-generator (pip), datamodel-code-generator (pypi). Check affected ranges and fixed versions before updating.

Analysis pending evidence review

HOL Guard separates source facts from reviewed analysis. See the methodology.

Published Jul 28, 2026Updated Oct 23, 2026Source checked Nov 1, 2026First seen by HOL Aug 2, 2026Material review Oct 23, 2026
Upstream Advisory

Record context

Vulnerability class
RCE
EPSS
Not reported
CWE IDs
CWE-94, CWE-1336
Source
GitHub Security Advisories
Source checked
Nov 1, 2026
References
5 linked sources
Open source record

Key facts

Risk
High · CVSS 7.8
Exploitation
Not marked as known exploited
Affected software
2 mapped packages or products
Fix availability
Available

Why this deserves its current priority

CVSS is 7.8. The current sources do not mark it as known exploited. Treat this as a source-backed prioritization signal, not a statement about your environment.

Analysis status

Analysis pending evidence review

Factual feed record only; HOL analysis is not approved for indexing. Read the methodology.

Affected scope and exposure questions

The current feed maps datamodel-code-generator (pip), datamodel-code-generator (pypi). Check affected ranges and fixed versions before updating.

Mapped affected packages and fixed versions
PackageAffected rangeFixed version
datamodel-code-generatorpip>=0.14.1,<=0.60.10.60.2
datamodel-code-generatorpypi>=0.14.1 <0.60.20.60.2

Recommended response

  1. 1Check inventory. Check lockfiles and deployed manifests for datamodel-code-generator, datamodel-code-generator.
  2. 2Review the reported fix. Update datamodel-code-generator to 0.60.2; datamodel-code-generator to 0.60.2 if you use the affected versions. Test the change in a non-production environment first.

Evidence timeline and material changes

  1. Published upstream

    Jul 28, 2026

    Evidence: source:ghsa:source_dates:source-dates:record
  2. Source modified

    Oct 23, 2026

    Evidence: source:ghsa:source_dates:source-dates:record
  3. First seen by HOL

    Aug 2, 2026

Sources and claim methodology

  • GitHub security advisorygithub.com
  • GitHub security advisorygithub.com
  • GitHub security advisorygithub.com
  • GitHub security advisorygithub.com
  • GitHub security advisorygithub.com
Upstream source description

### Summary `datamodel-code-generator` is vulnerable to code injection when a developer passes an `--extra-template-data` file whose `comment` value contains a literal `\r` (carriage return). The `comment` variable is rendered into a Python `#` comment in six built-in templates with **no** line-terminator escaping. Python's tokenizer treats a bare CR as a physical-line terminator (see [Python language reference — Physical lines](https://docs.python.org/3/reference/lexical_analysis.html#physical-lines)), so the comment ends at the `\r` and the text after it is parsed as Python, including, when the CR is followed by suitable indentation, as a statement within the class body that follows on the next template line. ### Details The vulnerable templates each contain `# {{ comment }}` with no escaping: - `src/datamodel_code_generator/model/template/TypeAliasAnnotation.jinja2:12` and `:19` - `src/datamodel_code_generator/model/template/TypeAliasType.jinja2:12` and `:19` - `src/datamodel_code_generator/model/template/TypeStatement.jinja2:12` and `:19` - `src/datamodel_code_generator/model/template/pydantic_v2/BaseModel.jinja2:4` - `src/datamodel_code_generator/model/template/pydantic_v2/RootModel.jinja2:19` - `src/datamodel_code_generator/model/template/pydantic_v2/RootModelTypeAlias.jinja2:13` The `pydantic_v2/BaseModel.jinja2:4` site is representative: ```jinja2 class {{ class_name }}({{ base_class }}):{% if comment is defined %} # {{ comment }}{% endif %} ``` When the developer-supplied extras file populates `comment` for a model, the value reaches the template via `DataModel.extra_template_data` (set in `src/datamodel_code_generator/model/base.py:736-742`) and Jinja2 interpolates it raw. None of the templates use `comment_safe`, `escape_docstring`, or any other line-terminator filter. ### PoC Complete self contained POC is available at my secret gist: https://gist.github.com/thegr1ffyn/8ad6b8cb3cc2be9d3a0144aeb6896a3f ### Impact - **Who's affected**: any developer or CI pipeline that runs `datamodel-codegen --extra-template-data <file>` where the extras file is influenced by attacker-controlled input. Realistic scenarios include: - Extras file generated from a third-party schema-annotation system. - Extras file vendored from an upstream repository. - Extras file produced by a script that merges multiple `comment` sources. - Build pipelines that template the extras file from environment variables, ticket descriptions, or commit metadata. - **What it gains**: arbitrary Python code execution in the importer's process at `import` time. - **What it does NOT need**: the schema itself can be entirely benign; only the extras file needs to contain the malicious `comment`. - **What does block it**: not passing `--extra-template-data`, or rejecting extras files whose `comment` values contain `\r`, `\x0b`, or `\x0c` before invocation. ### Resolution The fix normalizes `comment` values from built-in `--extra-template-data` before template rendering. Inline comments now convert CRLF, bare CR, vertical tab, and form feed into LF and prefix continuation lines with `# `, so attacker-controlled text stays inside the generated Python comment block. ### Remediation Upgrade to `datamodel-code-generator` `0.60.2` or later. This issue affects `datamodel-code-generator` versions `>= 0.14.1, <= 0.60.1` and is fixed in `0.60.2`. Submitted by: Hamza Haroon (thegr1ffyn)

Quoted source text, attributed separately from HOL analysis.

Related CVEs

  • Prefab UI Pyodide sandbox escape to host RCEAlso CWE-94