Skip to main content
Vulnerability Database/CVE-2026-112264

CVE-2026-112264: BentoML Dockerfile Injection RCE Vulnerability

CVE-2026-112264 is a Dockerfile injection flaw in BentoML that enables remote code execution through malicious bentofile.yaml configurations. This article covers the technical details, affected versions, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-112264 Overview

CVE-2026-112264 is a Dockerfile instruction injection vulnerability affecting BentoML through version 1.4.39. The flaw exists in the legacy base.j2 Jinja template, which renders docker.env mapping keys without sanitizing embedded newline characters. Attackers can craft a malicious bentofile.yaml or import a poisoned bento archive that injects arbitrary RUN instructions into the generated Dockerfile. When a user executes bentoml containerize, the injected instructions execute during docker build, enabling access to build secrets and image poisoning. The issue is tracked under CWE-78 (OS Command Injection).

Critical Impact

Attacker-controlled bento artifacts can execute arbitrary commands during container builds, exfiltrating build-time secrets and injecting backdoors into downstream production images.

Affected Products

  • BentoML versions up to and including 1.4.39
  • Container build workflows invoking bentoml containerize
  • CI/CD pipelines ingesting third-party or untrusted bento archives

Discovery Timeline

  • 2026-10-19 - CVE-2026-112264 published to NVD
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-112264

Vulnerability Analysis

BentoML is an open-source framework for packaging and serving machine learning models. The bentoml containerize command generates a Dockerfile from a Jinja template located at src/bentoml/_internal/container/frontend/dockerfile/templates/base.j2. This template iterates over the docker.env mapping defined in the project's bentofile.yaml and emits ENV directives using each key/value pair.

The template does not validate or escape newline characters within mapping keys. An attacker who controls the bentofile.yaml, or who distributes a bento archive imported through BentoML's standard workflow, can embed \n sequences into an environment variable name. The newline terminates the generated ENV line and allows arbitrary Dockerfile directives such as RUN to be injected into the subsequent build context.

Root Cause

The root cause is missing input sanitization in the template rendering path within build_config.py and generate.py. BentoML trusts the structure of docker.env keys and renders them directly into the Dockerfile without stripping control characters. The legacy base.j2 template compounds the issue by writing raw key values into instruction-sensitive positions.

Attack Vector

Exploitation requires that a victim invoke bentoml containerize against a bento artifact supplied by the attacker. Delivery vectors include a shared repository, a package registry, or an imported bento archive. When the victim runs the build, Docker executes the injected RUN instructions with the privileges of the build process. The attacker can read mounted build secrets, pull additional stages, or embed persistent payloads into the resulting image. See the VulnCheck advisory and the BentoML Dockerfile template source for technical details.

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-112264

Indicators of Compromise

  • Unexpected RUN, COPY, or ADD instructions in Dockerfiles produced by bentoml containerize.
  • bentofile.yaml files containing environment variable keys with embedded newline, carriage return, or shell metacharacters.
  • Outbound network connections from build runners to unknown hosts during BentoML image construction.
  • Container images with unexplained layers, secret-exfiltration binaries, or modified entrypoints after a BentoML build.

Detection Strategies

  • Statically scan bentofile.yaml and bento archives for non-printable characters in docker.env keys before building.
  • Diff generated Dockerfiles against a known-good baseline template to spot injected directives.
  • Enable Docker BuildKit audit logging and review docker build output for instructions that do not match the authored template.

Monitoring Recommendations

  • Monitor CI/CD runners for process execution originating from docker build child processes during BentoML workflows.
  • Alert on access to secret-mount paths such as /run/secrets/ during BentoML containerization jobs.
  • Track imports of external bento archives and correlate with subsequent bentoml containerize invocations.

How to Mitigate CVE-2026-112264

Immediate Actions Required

  • Stop running bentoml containerize against bento archives or bentofile.yaml files from untrusted sources.
  • Audit existing CI/CD pipelines for recent BentoML builds that may have produced tainted images and quarantine affected artifacts.
  • Rotate any build-time secrets (registry tokens, cloud credentials, signing keys) that were exposed to BentoML build jobs on vulnerable versions.
  • Review downstream container registries for images built with BentoML 1.4.39 or earlier and rebuild from trusted sources.

Patch Information

No fixed version is listed in the NVD entry at the time of publication. Monitor the BentoML repository and the VulnCheck advisory for an official release that sanitizes docker.env keys and updates the base.j2 template.

Workarounds

  • Pre-validate bentofile.yaml with a schema or linter that rejects environment variable names containing characters outside [A-Za-z0-9_].
  • Build BentoML images only inside ephemeral, network-restricted runners with no persistent secret mounts.
  • Avoid importing bento archives from untrusted authors; verify archive provenance with signatures before building.
  • Manually inspect the generated Dockerfile prior to invoking docker build when working with third-party bentos.
bash
# Configuration example: reject bentofile.yaml with unsafe docker.env keys
python - <<'EOF'
import sys, yaml, re
cfg = yaml.safe_load(open('bentofile.yaml'))
env = (cfg.get('docker') or {}).get('env') or {}
for k in env:
    if not re.fullmatch(r'[A-Za-z0-9_]+', k):
        print(f'Unsafe docker.env key rejected: {k!r}')
        sys.exit(1)
print('bentofile.yaml docker.env keys validated')
EOF

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.