Edgewall Software
Modify

Opened 5 years ago

Closed 5 years ago

#13292 closed defect (fixed)

Log has "IndexError: list index out of range" for requests to /captcha

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: plugin - spam-filter
Component: plugin/spamfilter Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Fix IndexError on invalid keycaptcha response.

Description

2020-05-08 05:32:12,772 Trac[main] ERROR: [49.196.17.54] Internal Server Error: <RequestWithSession "POST '/captcha'">, referrer 'https://trac-hacks.org/captcha'
Traceback (most recent call last):
  File "/srv/trac-hacks.org/pve/local/lib/python2.7/site-packages/trac/web/main.py", line 647, in _dispatch_request
    dispatcher.dispatch(req)
  File "/srv/trac-hacks.org/pve/local/lib/python2.7/site-packages/trac/web/main.py", line 215, in dispatch
    chosen_handler = self._pre_process_request(req, chosen_handler)
  File "/srv/trac-hacks.org/pve/local/lib/python2.7/site-packages/trac/web/main.py", line 455, in _pre_process_request
    chosen_handler = filter_.pre_process_request(req, chosen_handler)
  File "/srv/trac-hacks.org/pve/local/lib/python2.7/site-packages/tracspamfilter/captcha/api.py", line 174, in pre_process_request
    valid = self.captcha.verify_captcha(req)
  File "/srv/trac-hacks.org/pve/local/lib/python2.7/site-packages/tracspamfilter/captcha/keycaptcha.py", line 84, in verify_captcha
    s = hashlib.md5('accept' + val[1] + self.private_key +
IndexError: list index out of range

Attachments (0)

Change History (2)

comment:1 by Ryan J Ollos, 5 years ago

Keycaptcha response example:

1acf4ee512651ef9f7dbd63327366fad|47675d22f42287b26b1de77160a38dc8|http://back10.keycaptcha.com/swfs/ckc/2230e23aad868eb29fc2863a962ad6b3-|9602955-3.4.0.001|1

After splitting on |, the length if 5: plugins/1.2/spam-filter/tracspamfilter/captcha/keycaptcha.py@17014:83#L76

comment:2 by Ryan J Ollos, 5 years ago

Internal Changes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to 1.2 branch in r17342, merged in r17343, r17344.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.