Skip to content
Merged
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
4 changes: 2 additions & 2 deletions app/atomic_svc.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _handle_attachment(self, attachment_path):
payload_name = os.path.basename(attachment_path)
# to avoid collisions between payloads with the same name
with open(attachment_path, 'rb') as f:
h = hashlib.md5(f.read()).hexdigest()
h = hashlib.md5(f.read(), usedforsecurity=False).hexdigest()
payload_name = h[:PREFIX_HASH_LEN] + '_' + payload_name
shutil.copyfile(attachment_path, os.path.join(self.payloads_dir, payload_name), follow_symlinks=False)
return payload_name
Expand Down Expand Up @@ -301,7 +301,7 @@ async def _save_ability(self, entries, test):
"""
Return True if an ability was saved.
"""
ability_id = hashlib.md5(json.dumps(test).encode()).hexdigest()
ability_id = hashlib.md5(json.dumps(test).encode(), usedforsecurity=False).hexdigest()

tactics_li = self.technique_to_tactics.get(entries['attack_technique'], ['redcanary-unknown'])
tactic = 'multiple' if len(tactics_li) > 1 else tactics_li[0]
Expand Down
Loading