-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add testbed for Gradio CVE-2023-51449
- Loading branch information
Showing
4 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Gradio CVE-2023-51449 | ||
|
||
## Vulnerable setup | ||
|
||
```bash | ||
docker build -t gradio:vuln -f vulnerable.Dockerfile . | ||
docker run --name gradio-vuln -p 8000:8000 -d gradio:vuln | ||
``` | ||
|
||
Application will be available at `localhost:8000` | ||
|
||
## Non-vulnerable setup | ||
|
||
```bash | ||
docker build -t gradio:novuln -f non-vulnerable.Dockerfile . | ||
docker run --name gradio-novuln -p 8000:8000 -d gradio:novuln | ||
``` | ||
|
||
Application will be available at `localhost:8000` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM python:3.9-slim | ||
|
||
RUN python -m pip install gradio==4.11.0 | ||
|
||
ADD test_app.py /workspace/ | ||
|
||
EXPOSE 8000 | ||
|
||
CMD [ "python3" , "/workspace/test_app.py" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import gradio as gr | ||
|
||
def greet(name, intensity): | ||
return "Hello, " + name + "!" * int(intensity) | ||
|
||
demo = gr.Interface( | ||
fn=greet, | ||
inputs=["text", "slider"], | ||
outputs=["text"], | ||
) | ||
|
||
if __name__ == "__main__": | ||
demo.launch(server_name="0.0.0.0", server_port=8000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM python:3.9-slim | ||
|
||
RUN python -m pip install gradio==4.10.0 | ||
|
||
ADD test_app.py /workspace/ | ||
|
||
EXPOSE 8000 | ||
|
||
CMD [ "python3" , "/workspace/test_app.py" ] |