PyPI: ragas

CVE-2026-6587

Safety vulnerability ID: SFTY-20260420-91347

Safety legacy ID: pyup.io-95048

Affected versions of the ragas package are vulnerable to Server-Side Request Forgery due to insufficient validation of attacker-controlled URL and file path arguments in the Collections Module. The flaw resides in the _try_process_local_file and _try_process_url functions in src/ragas/metrics/collections/multi_modal_faithfulness/util.py, which process the retrieved_contexts argument without restricting outbound destinations, and the previous patch for CVE-2025-45691 was applied only to a different module. A remote attacker can manipulate retrieved_contexts to coerce the package into issuing unauthorised requests to attacker-chosen destinations, with a public exploit available.

Created at: May 1, 2026Updated at: May 1, 2026

Overview

RAGAS has SSRF via Multi-Modal Faithfulness Collections Module

Advisory

Affected versions of the ragas package are vulnerable to Server-Side Request Forgery due to insufficient validation of attacker-controlled URL and file path arguments in the Collections Module. The flaw resides in the _try_process_local_file and _try_process_url functions in src/ragas/metrics/collections/multi_modal_faithfulness/util.py, which process the retrieved_contexts argument without restricting outbound destinations, and the previous patch for CVE-2025-45691 was applied only to a different module. A remote attacker can manipulate retrieved_contexts to coerce the package into issuing unauthorised requests to attacker-chosen destinations, with a public exploit available.

Affected Package

Affecting ragas package, versions
>=0.2.3,<=0.4.3

Also affects

---

How to Fix

We recommend updating ragas to the latest non-vulnerable version.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more