csrf-protection

How JSF 2.0 prevents CSRF

荒凉一梦 提交于 2019-11-30 06:58:37
问题 I am researching stuff I hear regularly that when doing a webapp in JSF 2.0 you are already protected from crossite - scripting and - request forgery. The following excerpt from a SO post confirms this: In JSF 2.0 this has been improved by using a long and strong autogenerated value instead of a rather predictable sequence value and thus making it a robust CSRF prevention. Can someone provide some more detail on this? How does this autogenerated value prevent CSRF? Thanks! 回答1: How does this

JQuery + AJAX + Django = CSRF ? [duplicate]

怎甘沉沦 提交于 2019-11-30 05:01:06
Possible Duplicate: "CSRF token missing or incorrect" while post parameter via AJAX in Django I wanted to send login data by AJAX to authenticate user, but it wasn't possible because of CSRF. Could You tell me what to add to my code to make it woking? my JavaScript file: $("#login").live("click", function() { var username = $(".login_username").val(); var password = $(".login_password").val(); $.ajax({ url: "/login", type: "POST", data: { username: username, password: password }, cache: false, success: function(tekst) { alert(tekst); } }); }); Arnaud Le Blanc There is a method explained here .

Laravel 5 and Internet Explorer : Token Mismatch

心不动则不痛 提交于 2019-11-30 04:37:35
问题 My Laravel5 website uses csrf tokens to prevent CSRF attacks. On Chrome and Firefox, eveything works fine. I submitted the site for my client to test and, when he uses Internet Explorer (9/10), he has "Token mismatch" errors on evey page using the token. I assume it is a cookie/session issue. After some research, I tried removing the slash in the cookie name ("laravel_session"), and changing the session driver ("file" by default). It didn't help. I know my client could change its "trust

Session timeout leads to Access Denied in Spring MVC when CSRF integration with Spring Security

偶尔善良 提交于 2019-11-30 03:12:17
问题 I have Integrated CSRF token with Spring Security in my Spring MVC Project. Everything work properly with CSRF token, token will be send from client side to server side. I have changed my logout process to make it POST method to send CSRF token and its works fine. I have face problem when session timeout is occurred, it needs to be redirected to spring default logout URL but it gives me Access Denied on that URL. How to override this behavior. I have include below line in Security config file

Play 2.5.4 - how to implement CSRF filters?

☆樱花仙子☆ 提交于 2019-11-29 23:00:47
问题 How does one implement CSRFfilters in Play 2.5.4? The play documentation is wrong (doesn't compile, and can't under the play 2.5.4 java api), the example here doesn't compile (Play 2.5 disable csrf protection for some requests). the 2.5 java API has a CRSFFilter class but it is not a sub class of EssentialFilter so cannot be added to the array of EssentialFilters because it is the wrong type. Is this functionality currently broken for Play 2.5.4 or is the documentation currently misleading

How can I disable Django's csrf protection only in certain cases?

旧时模样 提交于 2019-11-29 11:15:58
问题 I'm trying to write a site in Django where the API URLs are the same as user-facing URLs. But I'm having trouble with pages which use POST requests and CSRF protection. For example, if I have a page /foo/add I want to be able to send POST requests to it in two ways: As an end user (authenticated using a session cookie) submitting a form. This requires CSRF protection. As an API client (authenticated using a HTTP request header). This will fail if CSRF protection is enabled. I have found

InvalidAuthenticityToken errors in mobile

人盡茶涼 提交于 2019-11-29 07:35:19
I have read multiple questions and answers here on StackOverflow about InvalidAuthenticityToken and protect_from_forgery but get none the wiser. I have a website that get hundreds of these errors every day. They seem to be mainly (only?) from mobile but I have only verified that through samples. I understand why there is an AuthenticityToken and the need for adding <%= csrf_meta_tags %> in the application.html (which I have) as well as having protect_from_forgery in the application controller. I have both the csrf_meta_tags and: protect_from_forgery with: :exception in my Application

Express CSRF token validation

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 07:03:49
I'm having issues with CSRF tokens. When I submit a form, a new XSRF-TOKEN is being generated but I think I'm generating two different tokens, I'm kinda confused. There's also a token called _csrf , so I see two different cookies in developer tools (XSRF-TOKEN and _csrf), _csrf doesn't change after a post. What I want to do is to generate a new token for each post request and check whether it's valid or not. One thing I know that I should do it for security, but I stuck. It has been a long day and I'm new into Express and NodeJS. Here's my current setup. var express = require('express') ,

Yii2 How to properly create checkbox column in gridview for bulk actions?

那年仲夏 提交于 2019-11-29 04:36:42
I need to create "bulk actions" similar to wordpress posts management, so you can for example delete multiple records at a time. This is my approach, and works fine, but I'm sure it is not the best approach, since this method is vulnerable to CSRF hacks. Checkbox column in a gridview: GridView::widget([ 'dataProvider' => $dataProvider, 'columns' => [ ['class' => 'yii\grid\CheckboxColumn'], 'id'=>'grid', 'country', ], ]); Button that fires a function <a href="#" onclick="bulkAction('p');"> The function: <script> function bulkAction(a) { var keys = $('#grid').yiiGridView('getSelectedRows');

Grails 3 CSRF protection

醉酒当歌 提交于 2019-11-29 02:41:58
Is it possible to configure CSRF protection in grails3 app using spring-security plugin, I can't find anything except useToken attribute for grails form and then call withForm inside controller. But this is actually not a very flexible solution. I like approach with filter like here For csrf protection I reused org.springframework.security.web.csrf.CsrfFilter . You need to define new bean in grails resouces.groovy (See snipet below - csrfFilter bean). You can define your own accessDeniedHandler and requireCsrfProtectionMatcher . Here is the snippet from resources.groovy: csrfFilter(CsrfFilter,