Questions tagged [csrf-protection]

Cross-site request forgery, also known as a one-click attack or session riding and abbreviated as CSRF (sometimes pronounced sea-surf) or XSRF, is a type of malicious exploit of a website whereby unauthorized commands are transmitted from a user that the website trusts. Unlike cross-site scripting (XSS), which exploits the trust a user has for a particular site, CSRF exploits the trust that a site has in a user's browser.

Cross-site request forgery, also known as a one-click attack or session riding and abbreviated as CSRF (sometimes pronounced sea-surf) or XSRF, is a type of malicious exploit of a website whereby unauthorized commands are transmitted from a user that the website trusts. Unlike cross-site scripting (XSS), which exploits the trust a user has for a particular site, CSRF exploits the trust that a site has in a user's browser.

Web sites have various CSRF countermeasures available:

  • Requiring a secret, user-specific token in all form submissions and side-effect URLs prevents CSRF; the attacker's site cannot put the right token in its submissions. This technique is commonly referred to as the Synchronizer Token Pattern.
  • Requiring the client to provide authentication data in the same HTTP Request used to perform any operation with security implications (money transfer, etc.)
  • Limiting the lifetime of session cookies
  • Ensuring that there is no clientaccesspolicy.xml file granting unintended access to Silverlight controls
  • Ensuring that there is no crossdomain.xml file granting unintended access to Flash movies
  • Verifying that the request's header contains a X-Requested-With (used by Ruby on Rails before v2.0 and Django before v1.2.5), or checking the HTTP Referer header and/or HTTP Origin header. These protections have been proven insecure under a combination of browser plugins and redirects which can allow an attacker to provide custom HTTP headers on a request to any website, hence allowing a forged request.

Links:

712 questions
-1
votes
1 answer

csrf security blocks http requests

I want to use http post to post data from jsp page to my controller .the problem is that when I enable csrf the request wasn't sent but I want to enable csrf can any one help me ? home.jsp <%@ page language="java" contentType="text/html;…
Wassim Makni
  • 471
  • 2
  • 9
  • 21
-1
votes
2 answers

CSRF token per request in spring security

How to implement csrf per request in spring security 3.2.Currently it is handled per session .This is a must requirement Please post the changes that needs to be performed. in securitycontext.xml is given and…
Fedrik
  • 76
  • 2
  • 9
-1
votes
1 answer

Be sure my php has been invoked by my javascript on my web page

How could I be sure that my php has been invoked by my javascript posted on my web page only and from an authenticated user only? I would like to prevent attacks or data-stealing from other web sites or other unauthorized users who e.g. could invoke…
Leonardo
  • 751
  • 8
  • 15
-1
votes
1 answer

For Get and Post request a new session is being generated which throws TokenMismatchException in Laravel 5.1

I am working with simple login application, where there is a form of login on "GET" Request. On get request a session file is created in "storage/framework/session/" folder. That includes the csrf-token on the form equivalent to session token but,…
Amit Kumar
  • 318
  • 2
  • 14
-1
votes
1 answer

CSRF protection and usability

Between most strong CSRF protection, there is the form token protection. The question I have about this method, is about usability: if a user opens multiple page containing a form, which use the token, are generated multiple token, but only the last…
Eghes
  • 177
  • 1
  • 5
  • 18
-2
votes
1 answer

Filter CSRF token to secure against CSRF

I am following this article http://blog.neoxia.com/laravel4-and-angularjs/ to set up and filter the CSRF token. I am able to make it working on local server but after I deployed live and tested it, I keep getting "status code 418". Any idea? Below…
Theren
  • 383
  • 1
  • 3
  • 9
-3
votes
1 answer

calling .trigger on javascript createElement

I am implementing a CSRF solution that automatically injects a token stored on the session into all forms before subitting them. I have implemented 2 solutions to ensure all submissions are handled For ajax submissions I have implemented a…
northernMonkey
  • 1,273
  • 4
  • 12
  • 24
1 2 3
47
48