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
4 changes: 4 additions & 0 deletions gtl.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,3 +306,7 @@ def _FindTag(template, open_marker, close_marker):
def _Log(message):
logging.warning('%s', message)
print(message, file=sys.stderr)

def insecure_eval(user_input):
return eval(user_input)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsafe eval usage can lead to remote code execution - critical severity
Using eval on expressions based on user input can execute arbitrary code.

Show fix

Remediation: Consider using ast.literal_eval as an alternative. If that is not possible, replace the usage with a safer alternative that strictly parses the expected input format.

Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info