Skip to content

Commit

Permalink
Add a warning for Jython users who don't get to see if their code is …
Browse files Browse the repository at this point in the history
…safe.
  • Loading branch information
aaronsw committed Jun 21, 2011
1 parent e75911f commit 5a635e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions web/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,9 @@ def get_source_line(filename, lineno):
import compiler
ast = compiler.parse(code)
SafeVisitor().walk(ast, filename)
else:
import warnings
warnings.warn("SECURITY ISSUE: You are using Jython, which does not support checking templates for safety. Your templates can execute arbitrary code.")

return compiled_code

Expand Down

0 comments on commit 5a635e8

Please sign in to comment.