Skip to content

Commit eb759f7

Browse files
committed
Add Flask SSTI
1 parent acc34fc commit eb759f7

File tree

5 files changed

+73
-2
lines changed

5 files changed

+73
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ deployments instead of Docker Compose services.
1111
Deploy a vulnerable pgAdmin:
1212

1313
```
14-
k apply -f python/CVE-2023-5002/all.yaml
14+
k apply -f python/pgadmin/CVE-2023-5002/all.yaml
1515
```
1616

1717
```
@@ -23,7 +23,7 @@ Open http://localhost:5050 in your web browser to access pgAdmin console.
2323
> Uninstall pgAdmin with:
2424
>
2525
> ```
26-
> k delete -f python/CVE-2023-5002/all.yaml
26+
> k delete -f python/pgadmin/CVE-2023-5002/all.yaml
2727
> ```
2828
2929
## Contributing

python/flask/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Flask Server Side Template Injection
2+
3+
https://github.com/vulhub/vulhub/tree/master/flask/ssti

python/flask/all.yaml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
apiVersion: v1
3+
kind: Namespace
4+
metadata:
5+
name: vulnerable-flask-ssti
6+
---
7+
apiVersion: v1
8+
kind: ConfigMap
9+
metadata:
10+
name: source-code
11+
namespace: vulnerable-flask-ssti
12+
data:
13+
app.py: |
14+
from flask import Flask, request
15+
from jinja2 import Template
16+
17+
app = Flask(__name__)
18+
19+
@app.route("/")
20+
def index():
21+
name = request.args.get('name', 'guest')
22+
23+
t = Template("Hello " + name)
24+
return t.render()
25+
26+
if __name__ == "__main__":
27+
app.run()
28+
---
29+
apiVersion: v1
30+
kind: Service
31+
metadata:
32+
name: flask
33+
namespace: vulnerable-flask-ssti
34+
spec:
35+
selector:
36+
app: flask
37+
ports:
38+
- protocol: TCP
39+
port: 8000
40+
targetPort: 8000
41+
---
42+
apiVersion: apps/v1
43+
kind: Deployment
44+
metadata:
45+
name: flask
46+
namespace: vulnerable-flask-ssti
47+
spec:
48+
replicas: 1
49+
selector:
50+
matchLabels:
51+
app: flask
52+
template:
53+
metadata:
54+
labels:
55+
app: flask
56+
spec:
57+
containers:
58+
- name: flask
59+
image: docker.io/vulhub/flask:1.1.1@sha256:20d202d35fe99818878a3f844362210a21894bfab57b8acf23dfa3ade9a87026
60+
ports:
61+
- containerPort: 8000
62+
volumeMounts:
63+
- name: source-code
64+
mountPath: /app
65+
volumes:
66+
- name: source-code
67+
configMap:
68+
name: source-code
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)