Skip to content

Commit

Permalink
return None when a secure-cookie is forged
Browse files Browse the repository at this point in the history
  • Loading branch information
raullenchai committed Jul 3, 2012
1 parent ed7030d commit 1ca245f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tornado/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -2046,6 +2046,7 @@ def decode_signed_value(secret, name, value, max_age_days=31):
return None
if parts[1].startswith(b("0")):
logging.warning("Tampered cookie %r", value)
return None
try:
return base64.b64decode(parts[0])
except Exception:
Expand Down

0 comments on commit 1ca245f

Please sign in to comment.