yesod/yesod-auth
Maximilian Tagher a01051eaf6 Have the yesod-auth login form use a CSRF token
Closes #1159

Based on reading this [StackOverflow Post](http://stackoverflow.com/questions/6412813/do-login-forms-need-tokens-against-csrf-attacks) and skimming [this paper](http://seclab.stanford.edu/websec/csrf/csrf.pdf), using CSRF protection on login forms protects against a vulnerability where an attacker submits their own username/password in the login form. Later, the user uses the real site, but doesn't realize they're logged in as the attacker. This creates vulnerabilities like:

1. If the site logs the user's activity for them (e.g. recently watched videos on YouTube, previous searches on Google), the attacker can see this information by logging in.
2. The user adds sensitive information to the account, like credit card information, the attacker can login and potentially steal that information or use it on the site.

I don't think this vulnerability applies to the `Yesod.Auth.Hardcoded` plugin because the attacker couldn't create an account of their own.

However:

* If I understand the example in `Yesod.Auth.Hardcoded`, one use case is to share one login form that works for both the Hardcoded plugin as well as normal database-backed username/password login, in which case having a CSRF token makes sense
* I don't see a downside to having the CSRF token there
* It makes the Hardcoded plugin work with the CSRF middleware

Does this sound like the right solution?
2016-02-14 17:32:46 -08:00
..
Yesod Have the yesod-auth login form use a CSRF token 2016-02-14 17:32:46 -08:00
.gitignore Add 'yesod-auth/' from commit 'fe498e3dac01bfc999cad33b90a2b1b397785178' 2011-07-22 08:59:54 +03:00
auth2.hs Add 'yesod-auth/' from commit 'fe498e3dac01bfc999cad33b90a2b1b397785178' 2011-07-22 08:59:54 +03:00
browserid.hs Fix browserid.hs (closes #547) 2014-09-14 11:04:16 +03:00
ChangeLog.md Deprecate Yesod.Auth.GoogleEmail #1150 2016-01-21 09:00:50 +02:00
LICENSE Update license with MIT license 2012-04-29 09:38:45 +03:00
openid.hs Add the guessApproot function (pinging @gregwebs) 2015-10-13 10:32:25 +00:00
persona_sign_in_blue.png Include Persona login icon yesodweb/authenticate#19 2013-02-18 11:30:23 +02:00
README.md Doc link updates 2014-12-21 15:23:52 +02:00
Setup.lhs Add 'yesod-auth/' from commit 'fe498e3dac01bfc999cad33b90a2b1b397785178' 2011-07-22 08:59:54 +03:00
yesod-auth.cabal Deprecate Yesod.Auth.GoogleEmail #1150 2016-01-21 09:00:50 +02:00

yesod-auth

This package provides a pluggable mechanism for allowing users to authenticate with your site. It comes with a number of common plugins, such as OpenID, BrowserID (a.k.a., Mozilla Persona), and email. Other packages are available from Hackage as well. If you've written such an add-on, please notify me so that it can be added to this description.