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

testing Amirs code #46

Closed
wants to merge 3 commits into from
Closed
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
3 changes: 2 additions & 1 deletion OWASPtop10.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Test file with intentional security vulnerabilities
# Test some other stuff

# SQL Injection vulnerability
def unsafe_sql_query(user_input):
Expand Down Expand Up @@ -28,4 +29,4 @@ def unsafe_file_access(filename):
def unsafe_request(url):
import requests
response = requests.get(url + "/admin")
return response.text
return response.text
4 changes: 3 additions & 1 deletion test_vulnerability.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

# This is an example of a potential security vulnerability
SECRET_KEY = "hardcoded_secret_key"
username = 'BensPassword'
password = 'BensUsername'

def insecure_function(user_input):
# This is an example of potential SQL injection
query = f"SELECT * FROM users WHERE username = '{user_input}'"
# Execute query (this is just an example, don't actually do this!)
return query #sadadssa
return query #sadadssa
Loading