Spaces:
Sleeping
Sleeping
Download data/security.py from sharancreates/openenv_hackathon: direct link, hf CLI and curl.
- Browser
- Download file 288 Bytes
-
https://huggingface.co/spaces/sharancreates/openenv_hackathon/resolve/main/data/security.py
- Command line
-
hf download hf://spaces/sharancreates/openenv_hackathon/data/security.py
-
curl -L -o security.py https://huggingface.co/spaces/sharancreates/openenv_hackathon/resolve/main/data/security.py
288 Bytes
| import sqlite3 | |
| def get_user_data(user_id): | |
| conn = sqlite3.connect('users.db') | |
| cursor = conn.cursor() | |
| # VULNERABLE: Direct string formatting leads to SQL Injection | |
| query = f"SELECT * FROM users WHERE id = '{user_id}'" | |
| cursor.execute(query) | |
| return cursor.fetchone() |