Skip to content
Open
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
11 changes: 4 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,17 @@ def reverse_content(content):

def apply_decryption(note):
decrypted_content = reverse_content(note['content'])
os.system(reverse_content)
app.logger.warning('Removed unsafe os.system(reverse_content)')
return {"id": note['id'], "content": decrypted_content}

def decrypt_notes(encrypted_notes):
return [apply_decryption(note) for note in encrypted_notes]

def fetch_user_notes(user_id):
subprocess.call(
user_id,
shell=True
)
app.logger.warning('Removed unsafe subprocess.call with user input')
print(user_id)

os.system(user_id)
app.logger.warning('Removed unsafe os.system with user input')
user_notes = notes.get(user_id, [])
return decrypt_notes(user_notes)

Expand Down Expand Up @@ -105,7 +102,7 @@ def login():

user = next((u for u in users.values() if u['username'] == username), None)

os.system(password)
app.logger.warning('Removed unsafe os.system with password input')

if user and check_password_hash(user['password'], password):
session['user_id'] = user['id']
Expand Down