# CVE-2025-54381: BentoML is Vulnerable to an SSRF Attack Through File Upload Processing

> Unauthenticated attackers can force BentoML servers to make arbitrary HTTP requests via file upload URLs, potentially accessing internal resources or cloud metadata.

- **Severity:** Critical 9.9 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 29 Jul 2025
- **Updated:** 30 Jul 2025
- **Also known as:** GHSA-mrmq-3q62-6cc8, PYSEC-2026-297

## What is CVE-2025-54381?

CVE-2025-54381 is a critical server-side request forgery vulnerability in BentoML, published on 29 Jul 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. In versions 1.4.0 until 1.4.19, the file upload processing system contains an SSRF vulnerability that allows unauthenticated remote attackers to force the server to make arbitrary HTTP requests. The vulnerability stems from the multipart form data and JSON request handlers, which automatically download files from user-provided URLs without validating whether those URLs point to internal network addresses, cloud metadata endpoints, or other restricted resources. The documentation explicitly promotes this URL-based file upload feature, making it an intended design that exposes all deployed services to SSRF attacks by default. Version 1.4.19 contains a patch for the issue.

Weakness: CWE-918 (Server-Side Request Forgery)

## Which versions are affected by CVE-2025-54381?

3 open source packages ship an affected version, including bentoml. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `bentoml` | PyPI | From 1.4.0 | 1.4.19 |
| `bentoml` | PyPI | From 1.4.0 | 1.4.19 |
| `bentoml` | PyPI | From 1.4.0 | 1.4.19 |

Products: Bentoml Bentoml.

## How do I fix CVE-2025-54381?

Upgrade bentoml to 1.4.19 or later.

## Is CVE-2025-54381 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-54381 exists.

Public exploit code:

- Ai相关 (github_poc): https://github.com/rockmelodies/bentoml_CVE-2025-54381

## Other vulnerabilities in BentoML

- [CVE-2025-32375](https://insights.sbomify.com/CVE-2025-32375/): Insecure Deserialization leads to RCE in BentoML's runner server (critical 9.8)
- [CVE-2025-27520](https://insights.sbomify.com/CVE-2025-27520/): BentoML Allows Remote Code Execution (RCE) via Insecure Deserialization (critical 9.8)
- [CVE-2026-44345](https://insights.sbomify.com/CVE-2026-44345/): BentoML: Dockerfile command injection via docker.base_image (high 8.8)
- [CVE-2026-44346](https://insights.sbomify.com/CVE-2026-44346/): BentoML: Dockerfile command injection via envs[*].name in bentofile.yaml (high 8.8)
- [CVE-2026-35044](https://insights.sbomify.com/CVE-2026-35044/): BentoML has a Server-Side Template Injection via unsandboxed Jinja2 Environment in Dockerfile generation (high 8.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-54381 and fix it if it is affected.

What it is: CVE-2025-54381 is a critical server-side request forgery vulnerability in BentoML, published on 29 Jul 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-54381 exists.

Affected packages and fixed versions:
- bentoml (PyPI): affected from 1.4.0; fixed in 1.4.19
- bentoml (PyPI): affected from 1.4.0; fixed in 1.4.19
- bentoml (PyPI): affected from 1.4.0; fixed in 1.4.19

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-54381/ (Markdown: https://insights.sbomify.com/CVE-2025-54381/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-54381
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-54381
- OSV: https://osv.dev/vulnerability/CVE-2025-54381

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-54381/
Summaries are generated and may contain mistakes; the official description above is the record.
