BentoML RCE in Containerize (CVE-2026-35044)
CVE-2026-35044
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Prior to 1.4.38, the Dockerfile generation function generate_containerfile() in src/bentoml/_...
Overview
A high-severity vulnerability (CVE-2026-35044) exists in the BentoML open-source framework. The flaw is in the library’s Docker container generation feature. If a user imports a maliciously crafted Bento archive and runs the bentoml containerize command, an attacker can execute arbitrary Python code directly on the host system, completely bypassing the intended container isolation.
Vulnerability Details
BentoML versions prior to 1.4.38 are affected. The vulnerability resides in the generate_containerfile() function within the codebase. This function uses an unsandboxed Jinja2 template engine to process user-provided Dockerfile templates. The jinja2.ext.do extension is enabled, which allows the execution of arbitrary Python statements. When processing a malicious template embedded in a Bento archive, this code executes in the context of the host machine running the BentoML CLI, not inside a container. The attack requires user interaction (running the containerize command) but no special privileges.
Impact
The primary risk is remote code execution (RCE). An attacker could craft a poisoned AI model bundle and trick a developer or MLOps engineer into importing and containerizing it. Successful exploitation grants the attacker the same privileges as the user running the BentoML command, potentially leading to full compromise of the CI/CD server, developer workstation, or deployment host. This undermines the core security promise of containerization, as the attack escapes isolation before a container is even built.
Remediation and Mitigation
The fix is available in BentoML version 1.4.38. All users must upgrade immediately using the command:
pip install --upgrade bentoml>=1.4.38
Immediate Actions:
- Upgrade: Prioritize upgrading all development, CI/CD, and deployment environments that use BentoML.
- Audit Sources: Only containerize Bento bundles from trusted and verified sources. Treat externally sourced model archives with high suspicion.
- Network Controls: As the attack vector is network-based (downloading an archive), restrict outbound connections from build servers to only necessary, trusted repositories.
Until the patch is applied, avoid using the containerize command on any Bento archive from an unverified origin. For broader context on supply chain attacks, recent incidents are detailed in our breach reports.
Security Insight
This vulnerability highlights the escalating risks in the AI/ML toolchain, where complex packaging and deployment utilities can introduce critical supply chain weaknesses. Similar to past incidents in other DevOps tools, it shows how a seemingly innocuous templating feature can become a severe execution bypass. The flaw underscores that security in MLOps platforms must extend beyond model safety to include the integrity of the entire packaging and deployment pipeline itself.
Further Reading
Never miss a critical vulnerability
Get real-time security alerts delivered to your preferred platform.
Related Advisories
OpenOlat is an open source web-based e-learning platform for teaching, learning, assessment and communication. Prior to versions 19.1.31, 20.1.18, and 20.2.5, an authenticated user with the Author rol...
OpenCTI is an open source platform for managing cyber threat intelligence knowledge and observables. Prior to 6.9.5, the safeEjs.ts file does not properly sanitize EJS templates. Users with the Manage...
Flask-Reuploaded provides file uploads for Flask. A critical path traversal and extension bypass vulnerability in versions prior to 1.5.0 allows remote attackers to achieve arbitrary file write and re...
Due to the use of a vulnerable third-party Velocity template engine, a malicious actor with admin privilege may inject and execute arbitrary template syntax within server-side templates. Successful...