Github user rnewson commented on a diff in the pull request:
https://github.com/apache/couchdb-couch/pull/80#discussion_r35990139
--- Diff: src/couch_httpd_auth.erl ---
@@ -304,12 +310,19 @@ handle_session_req(#httpd{method='POST',
mochi_req=MochiReq}=Req, AuthModule) ->
UserSalt = couch_util:get_value(<<"salt">>, UserProps2),
CurrentTime = make_cookie_time(),
Cookie = cookie_auth_cookie(Req, ?b2l(UserName),
<<Secret/binary, UserSalt/binary>>, CurrentTime),
+ % maybe set the csrf token
+ Cookies = case couch_httpd:qs_value(Req, "csrf", "false") of
--- End diff --
If we don't make it optional then every client will be broken until they
add this custom header.
On basic auth, I tend to think of cookie auth being used by browsers/ui's
and basic auth being used by programs. CSRF is only an issue for browsers;
direct api interactions aren't vulnerable.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---