Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /Kolerr-Lab_supper-decoyable /tests /vulns.py
| import os | |
| import subprocess | |
| import pickle | |
| import hashlib | |
| import random | |
| # SQL injection vulnerability | |
| def get_user_data(user_id): | |
| query = "SELECT * FROM users WHERE id = " + user_id # Vulnerable to SQL injection | |
| return query | |
| # Command injection vulnerability | |
| def run_command(cmd): | |
| result = subprocess.call(cmd, shell=True) # Dangerous shell=True | |
| return result | |
| # Weak hashing | |
| def hash_password(password): | |
| return hashlib.md5(password.encode()).hexdigest() # MD5 is weak | |
| # Pickle deserialization (dangerous) | |
| def load_data(data): | |
| return pickle.loads(data) # Can execute arbitrary code | |
| # Hardcoded secret | |
| password = "supersecretpassword123456789" # Exposed secret | |
| # Insecure random | |
| def get_random_number(): | |
| return random.randint(1, 100) # Insecure random | |
| # Debug enabled | |
| DEBUG = True | |
| if __name__ == "__main__": | |
| print("Test file with vulnerabilities") |
Xet Storage Details
- Size:
- 890 Bytes
- Xet hash:
- 38b0651f448fb7b17d88c5a69cb8998514c2188a385b24c20e0bb8fbca5ed398
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.