Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testbed for Gardio exposed UI & arbitrary file read #38

Merged
merged 1 commit into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions gradio/CVE-2023-51449/README.md
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`
9 changes: 9 additions & 0 deletions gradio/CVE-2023-51449/non-vulnerable.Dockerfile
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" ]
13 changes: 13 additions & 0 deletions gradio/CVE-2023-51449/test_app.py
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)
9 changes: 9 additions & 0 deletions gradio/CVE-2023-51449/vulnerable.Dockerfile
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" ]