Skip to content

Commit

Permalink
prevent malicious tokens from being anything but urlsafe base64
Browse files Browse the repository at this point in the history
  • Loading branch information
diafygi committed Dec 4, 2015
1 parent a866b25 commit 1775b70
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions acme_tiny.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def _send_signed_request(url, payload):

# make the challenge file
challenge = [c for c in json.loads(result)['challenges'] if c['type'] == "http-01"][0]
challenge['token'] = re.sub("[^A-Za-z0-9_\-]", "_", challenge['token'])
keyauthorization = "{0}.{1}".format(challenge['token'], thumbprint)
wellknown_path = os.path.join(acme_dir, challenge['token'])
wellknown_file = open(wellknown_path, "w")
Expand Down

2 comments on commit 1775b70

@jomo
Copy link
Contributor

@jomo jomo commented on 1775b70 Dec 4, 2015

Choose a reason for hiding this comment

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

See #16 :)

@diafygi
Copy link
Owner Author

@diafygi diafygi commented on 1775b70 Dec 4, 2015

Choose a reason for hiding this comment

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

Yep, fixed in 47ebd61

Please sign in to comment.