Skip to content

Commit

Permalink
Remove unnecessary command injection checks in tests
Browse files Browse the repository at this point in the history
Co-authored-by: Omry Yadan <omry@yadan.net>
  • Loading branch information
jesszzzz and omry authored Jul 15, 2024
1 parent 9bf7c40 commit c7fc511
Showing 1 changed file with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@

def _run_command(command: str) -> str:
print(f"{str( datetime.now() )} - OUT: {command}")
# Do some basic validation to avoid injection but it is not exhaustive,
# there is still a security risk here!
if ";" in command or "||" in command or "&&" in command or ">" in command:
raise ValueError(
"To avoid possible injection, command cannot contain ; || or &&"
)
output = subprocess.getoutput(command) # nosec B605
print(f"{str( datetime.now() )} - OUT: {output}")
return output
Expand Down

0 comments on commit c7fc511

Please sign in to comment.