Page MenuHomePhabricator

Malformed URI relating to badly set cookies that cannot be decoded by $.cookie
Closed, ResolvedPublic

Description

Several hundred errors from several IPs a day
If a gadget sets an invalid cookie this creates logspam on every page view.

$.cookie.raw = true
$.cookie('test_cookie', '99%E9%80%83%E4%BA')
$.cookie.raw = false

The logspam can be stopped by setting the cookie like so:

$.cookie('test_cookie', '')

We appear to be using a forked version of the cookie library (1.3.1) but this was fixed in a later version (https://github.com/carhartl/jquery-cookie/blob/master/src/jquery.cookie.js#L41). That said the library is no longer mantained.

https://logstash.wikimedia.org/goto/15b00da66ff9d67d30f3cf63a2f0381b

Given this error can originate from a script from user input and can potentially cause a high amount of errors I think we should fix this.

Event Timeline

Change 655719 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/core@master] Catch malformed URI exceptions when decoding cookies

https://gerrit.wikimedia.org/r/655719

Change 655719 merged by jenkins-bot:
[mediawiki/core@master] Catch malformed URI exceptions when decoding cookies

https://gerrit.wikimedia.org/r/655719