You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An Open Redirect vulnerability has been identified in the text-generation-webui project. The issue stems from improper validation of the file parameter in Gradio (versions ≤ 4.36.1). This allows an attacker to redirect users to malicious external URLs. The vulnerability is tracked as CVE-2024-4940.
Bug Description
When the file parameter is supplied with an external URL, the application treats it as a valid file path without validation, leading to unintended redirection to the specified URL.
Workaround
1. Update your Gradio version
It is important to update Gradio to the latest 4.37.1 or later, as this vulnerability can occur in Gradio versions 4.36.1 and earlier.
To do so, use the following command: pip install gradio >= 4.37.1 2. Validate external URLs
We need to add external URL validation logic for values passed to the gr.File() component in the ui function. This allows us to check whether the URL is a local file path or an external URL, and block external URLs for added security.
Is there an existing issue for this?
I have searched the existing issues
Reproduction
1. Launch the text-generation-webui.
2. Access the web interface through a browser.
3. Provide an external URL as the file parameter, such as http://127.0.0.1:7860/file=https://google.com
4. Observe that the application redirects to the external URL (https://google.com) instead of rejecting the input.
Comment
The vulnerability arises from insufficient validation in the gr.File() component of Gradio. Specifically, the ui() function in /extensions/superbooga/script.py processes the file parameter as a local file path without validation, enabling redirection to attacker-controlled URLs.
Screenshot
Steps to reproduce the issue:
Access the interface and input an external URL:
Observe the redirection:
2024-scable
changed the title
[Security Issue]: Open Redirect Vulnerability in Text Generation Webui via Gradio (CVE-2024-4940)
[Security Issue]: Open Redirect Vulnerability in Text Generation WebUI via Gradio (CVE-2024-4940)
Dec 16, 2024
Describe the bug
An Open Redirect vulnerability has been identified in the text-generation-webui project. The issue stems from improper validation of the file parameter in Gradio (versions ≤ 4.36.1). This allows an attacker to redirect users to malicious external URLs. The vulnerability is tracked as CVE-2024-4940.
Bug Description
When the file parameter is supplied with an external URL, the application treats it as a valid file path without validation, leading to unintended redirection to the specified URL.
Workaround
1. Update your Gradio version
pip install gradio >= 4.37.1
2. Validate external URLs
gr.File()
component in theui
function. This allows us to check whether the URL is a local file path or an external URL, and block external URLs for added security.Is there an existing issue for this?
Reproduction
1. Launch the text-generation-webui.
2. Access the web interface through a browser.
3. Provide an external URL as the file parameter, such as
http://127.0.0.1:7860/file=https://google.com
4. Observe that the application redirects to the external URL (https://google.com) instead of rejecting the input.
Comment
The vulnerability arises from insufficient validation in the gr.File() component of Gradio. Specifically, the ui() function in /extensions/superbooga/script.py processes the file parameter as a local file path without validation, enabling redirection to attacker-controlled URLs.
Screenshot
Steps to reproduce the issue:
Access the interface and input an external URL:
Observe the redirection:
Logs
System Info
The text was updated successfully, but these errors were encountered: