diff options
author | Timothy Flynn <trflynn89@pm.me> | 2021-04-15 08:44:59 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-16 19:19:31 +0200 |
commit | 67884f6747fef572a5984a6c690abf96d898530d (patch) | |
tree | e5ff9e0c84b15427cd892d19430fb4045c4244d8 /Base/res | |
parent | da92c0e1ca2be53df4a7889090656b428869d140 (diff) | |
download | serenity-67884f6747fef572a5984a6c690abf96d898530d.zip |
LibWeb: Impose a sane max cookie size
Drop cookies larger than 4KiB. This value is the RFC's recommendation:
https://tools.ietf.org/html/rfc6265#section-6.1
Diffstat (limited to 'Base/res')
-rw-r--r-- | Base/res/html/misc/cookie.html | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Base/res/html/misc/cookie.html b/Base/res/html/misc/cookie.html index c0531b11cb..23359e32ac 100644 --- a/Base/res/html/misc/cookie.html +++ b/Base/res/html/misc/cookie.html @@ -14,6 +14,8 @@ <label for=invalid3>The cookie expired in the past</label> <br /><input id=invalid4 type=button onclick="setCookie(this.value)" value="cookie7=value7; expires=Mon, 23 Jan 1989 08:10:36 GMT" /> <label for=invalid4>The cookie expired in the past</label> + <br /><input id=invalid5 type=button onclick="setTooLargeCookie()" value="cookie10=[more than 4096 chars]" /> + <label for=invalid5>The cookie is too large</label> <br /> <h3>Unretrievable cookies (the browser should accept these but not display them):</h3> @@ -31,6 +33,11 @@ document.getElementById('cookies').innerHTML = document.cookie; } + function setTooLargeCookie() { + const cookie = 'name=' + 'x'.repeat(4 << 10); + setCookie(cookie); + } + document.getElementById('cookies').innerHTML = document.cookie; </script> </body> |