csrf

Yesod 1.2 CSRF protection

痞子三分冷 提交于 2020-08-07 10:31:53
问题 I'm confused about Yesod's CSRF protection, and how Yesod's forms work in general. It's my understanding that Yesod's form system uses a "token" which is passed into the HTML realization of the form as a hidden field. When the form is processed, the token is compared to one stored (or at least recreated) on the server. I'd like to track that down, because the CSRF protection is being triggered spuriously in my development environment, and I'd like to change my environment so the forms work

Weird CSRF error in Django with Nginx and Gunicorn

落花浮王杯 提交于 2020-07-22 22:16:46
问题 Background When I try to access into my Django administration panel, I get Forbidden (403) CSRF verification failed. Request aborted. , even if I disable the CSRF middleware. This affects all users, in different locations with different browsers. I've followed the steps to fix this error of several questions in stackoverflow, but still the same. This has been killing me for weeks. Issue I'm using https with Cloudflare (Free plan), but this error persist if I deactivate https. This occurs in

Weird CSRF error in Django with Nginx and Gunicorn

白昼怎懂夜的黑 提交于 2020-07-22 22:16:17
问题 Background When I try to access into my Django administration panel, I get Forbidden (403) CSRF verification failed. Request aborted. , even if I disable the CSRF middleware. This affects all users, in different locations with different browsers. I've followed the steps to fix this error of several questions in stackoverflow, but still the same. This has been killing me for weeks. Issue I'm using https with Cloudflare (Free plan), but this error persist if I deactivate https. This occurs in

ValidateAntiForgeryToken in an ASP.NET Core React SPA Application

↘锁芯ラ 提交于 2020-07-15 02:14:48
问题 I'm trying to use the framework's tools to add some simple CSRF validation to an ASP.NET Core React SPA. The application itself is essentially a create-react-app setup (a single index.html with a root element and everything else is loaded in from bundled JavaScript). Tinkering with some information found on links such as this one, I've set the following in my Startup.ConfigureServices : services.AddAntiforgery(options => options.Cookie.Name = "X-CSRF-TOKEN"); And confirmed in my Chrome tools

ValidateAntiForgeryToken in an ASP.NET Core React SPA Application

不打扰是莪最后的温柔 提交于 2020-07-15 02:14:34
问题 I'm trying to use the framework's tools to add some simple CSRF validation to an ASP.NET Core React SPA. The application itself is essentially a create-react-app setup (a single index.html with a root element and everything else is loaded in from bundled JavaScript). Tinkering with some information found on links such as this one, I've set the following in my Startup.ConfigureServices : services.AddAntiforgery(options => options.Cookie.Name = "X-CSRF-TOKEN"); And confirmed in my Chrome tools

React frontend and REST API, CSRF

白昼怎懂夜的黑 提交于 2020-07-04 05:25:31
问题 Using React on the frontend with a RESTful API as backend and authorisation by JWT, how do we handle sessions? For example after login, I get a JWT token from REST. If I save it to localStorage I am vulnerable to XSS, if I save it to cookies, same problems except I set cookies to HttpOnly, but React can't read HttpOnly Cookies (I need to read cookie to take JWT from it, and use this JWT with REST requests), also I didn't mention CSRF problem. If you're using REST as backend, you can't use