CVE-2025-23042
Gradio ACL bypass via case-sensitive file path check, allows access to protected files.
- CVSS 8.7
- CWE-285
- Input Validation and Sanitization
- Remote
Gradio is an open-source Python package that allows quick building of demos and web application for machine learning models, API, or any arbitrary Python function. Gradio's Access Control List (ACL) for file paths can be bypassed by altering the letter case of a blocked file or directory path. This vulnerability arises due to the lack of case normalization in the file path validation logic. On case-insensitive file systems, such as those used by Windows and macOS, this flaw enables attackers to circumvent security restrictions and access sensitive files that should be protected. This issue can lead to unauthorized data access, exposing sensitive information and undermining the integrity of Gradio's security model. Given Gradio's popularity for building web applications, particularly in machine learning and AI, this vulnerability may pose a substantial threat if exploited in production environments. This issue has been addressed in release version 5.6.0. Users are advised to upgrade. There are no known workarounds for this vulnerability.
- CWE
- CWE-285
- CVSS base score
- 8.7
- Published
- 2025-01-14
- OWASP
- A01 Broken Access Control
- Orthogonal defect classification
- Checking
- Code defect classification
- Incorrect Check
- Category
- Input Validation and Sanitization
- Subcategory
- Path Traversal
- Accessibility scope
- Remote
- Impact
- Information Disclosure
- Affected component
- Gradio
- Fixed by upgrading
- Yes
Solution
Upgrade to version 5.6.0.
Vulnerable code sample
import os
def is_path_allowed(filepath, allowed_paths):
for allowed_path in allowed_paths:
if filepath.startswith(allowed_path):
return True
return FalsePatched code sample
import os
def is_path_allowed(filepath, allowed_paths):
normalized_filepath = os.path.normpath(filepath).lower()
for allowed_path in allowed_paths:
normalized_allowed_path = os.path.normpath(allowed_path).lower()
if normalized_filepath.startswith(normalized_allowed_path):
return True
return FalsePayload
`../../../SeCrEtFiLe.TxT`
Cite this entry
@misc{vaitp:cve202523042,
title = {{Gradio ACL bypass via case-sensitive file path check, allows access to protected files.
}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2025},
note = {VAITP Python Vulnerability Dataset, entry CVE-2025-23042},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2025-23042/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
