Executive brief
RAGAS, a framework used to evaluate Retrieval-Augmented Generation (RAG) systems, contains a security flaw in how it handles image and text inputs. An attacker can provide a specially crafted web address (URL) that tricks the system into reading sensitive files from the server's local storage or accessing private internal network services. This could lead to the theft of confidential data, such as system passwords or cloud service credentials, potentially compromising the entire server environment.
Technical details
An arbitrary file read vulnerability exists in the ImageTextPromptValue class within RAGAS versions 0.2.3 through 0.2.14. The flaw stems from improper validation and sanitization of URLs provided in the 'retrieved_contexts' parameter when handling multimodal inputs. Specifically, the 'is_image' check can be bypassed using URL fragments (e.g., 'file://localhost/etc/passwd#payload.jpg'), which causes Python's mimetypes to identify the string as an image while 'urllib.request.urlopen' retrieves the local file. An unauthenticated remote attacker can exploit this to read sensitive local files, perform internal port scans, or access cloud metadata (SSRF). The issue has been addressed in subsequent updates and pull request #1991.
Affected products
- Exploding Gradients RAGAS 0.2.3 to 0.2.14
- Red Hat Red Hat OpenShift AI (RHOAI)
Timeline
- 2024-10-25: other: Vulnerability introduced in v0.2.3 via multimodal support PR
- 2025-05-05: patched: Fix merged in pull request 1991
- 2026-03-05: advisory: CVE-2025-45691 published
References
- https://adithyanak.com/ragas-v0214-arbitrary-file-read-vulnerability
- https://github.com/explodinggradients/ragas/blob/e97886ac976465efb60e5949c5d69baf30cc811d/src/ragas/prompt/multi_modal_prompt.py
- https://github.com/explodinggradients/ragas/pull/1559
- https://github.com/vibrantlabsai/ragas/pull/1991
- https://access.redhat.com/security/cve/CVE-2025-45691
- https://bugzilla.redhat.com/show_bug.cgi?id=2444875
- https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-45691.json