yesod/yesod-core/test
Evan Rutledge Borden b50ca99566 Deprecate insecure JSON body functions
`parseJsonBody` and `requireJsonBody` do not require a mime type when
parsing `JSON` content. This leaves them open to CSRF. They are now
deprecated and `insecure` versions are added in their place. Consumers
are now given a proper choice between secure and insecure functions.

There is a potential attack vector in that the browser does not trigger
CORS requests for "simple requests", which includes POST requests that
are form or text content-types. An attacker can craft a form whose body
is valid JSON, and when a user visits attacker.com and submits that
form, it can be submitted to bank.com and bypass CORS.

Checking the content-type is application/json prevents this, because if
the content-type was set to application/json, then the browser would
send a CORS request—a preflight OPTIONS request to the server asking if
the current domain (and some other values) are whitelisted to send
requests to that server. If the server doesn't say attacker.com is
whitelisted, the browser will not send the real request to the server.
2019-01-24 09:12:48 -06:00
..
fixtures In the route syntax, allow trailing backslashes to indicate line continuation. 2018-10-08 16:47:06 -04:00
YesodCoreTest Deprecate insecure JSON body functions 2019-01-24 09:12:48 -06:00
en.msg Add 'yesod-core/' from commit '982d6185bee75b078bee92bd8a2e8743707f1922' 2011-07-22 08:59:56 +03:00
Hierarchy.hs
RouteSpec.hs In the route syntax, allow trailing backslashes to indicate line continuation. 2018-10-08 16:47:06 -04:00
test.hs
YesodCoreTest.hs