init: deliberately vulnerable demo (CWE-798/327/89/78/319)

This commit is contained in:
test
2026-07-21 10:39:18 +02:00
commit 8cdac0dcb6
5 changed files with 31 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
import os
def get_user(conn, user_id):
cur = conn.cursor()
cur.execute("SELECT * FROM users WHERE id = " + user_id) # SQL injection (CWE-89)
return cur.fetchall()
def ping(host):
os.system("ping -c 1 " + host) # command injection (CWE-78)