Closed bakert closed 6 years ago
Ohhhhh...
This is the definitely the result of a script-kiddie tool.
This is easy enough to fix, now that we know it's malicious input.
Another 25 of these last night trying to put somewhat-database-looking gibberish in. Silly.
expected only letters, got '554'
Reported on decksite by logged_out
Request Method: GET
Path: /?locale=554
Cookies: {}
Endpoint: home
View Args: {}
Person: logged_out
Referrer: None
Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 157.55.39.152, 162.158.146.126
Cf-Ray: 3fdf3c12bf043b38-YVR
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: no-cache
Pragma: no-cache
Accept: /
From: bingbot(at)microsoft.com
User-Agent: Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)
Cf-Connecting-Ip: 157.55.39.152
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive--------------------------------------------------------------------------------
ValueError
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1997, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/cache.py", line 65, in decorated_function
response = make_response(f(*args, **kwargs))
File "./decksite/main.py", line 45, in home
view = Home(ns.load_news(max_items=10), ds.load_decks(limit='LIMIT 50'), cs.played_cards())
File "./decksite/views/home.py", line 19, in init
self.active_runs = ngettext('%(num)d active league run', '%(num)d active league runs', len(active_runs))
File "/home/discord/.local/lib/python3.6/site-packages/flask_babel/init.py", line 573, in ngettext
t = get_translations()
File "/home/discord/.local/lib/python3.6/site-packages/flask_babel/init.py", line 227, in get_translations
[get_locale()],
File "/home/discord/.local/lib/python3.6/site-packages/flask_babel/init.py", line 261, in get_locale
locale = Locale.parse(rv)
File "/home/discord/.local/lib/python3.6/site-packages/babel/core.py", line 268, in parse
parts = parse_locale(identifier, sep=sep)
File "/home/discord/.local/lib/python3.6/site-packages/babel/core.py", line 1094, in parse_locale
raise ValueError('expected only letters, got %r' % lang)
I should get around to patching this, I guess.
This happened 71 times (possibly a browsers auto retry?) a few hours ago. Could be script kiddie stuff but looks like maybe a bug with i18n?