You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
- Ideally, the anti-CSRF-token should not be stored in cookies at all. Only in the html-form.Martin Fürholz– Martin Fürholz2018-11-30 10:43:46 +00:00Commented Nov 30, 2018 at 10:43
- "An attacker would only be able to manipulate the current, active session of that particular user whom he stole the anti-CSRF token from". Yes I understand it would have to be that particular user's session whos anti-csrf token was stolen, however, that means the attacker could potentially hijack that particular session right? I know the chances of this happening is very low, but it is still a vulnerability.EJC– EJC2018-11-30 15:23:32 +00:00Commented Nov 30, 2018 at 15:23
- Also, what's the difference between putting the anti-csrf in the hidden form field vs cookie and then copying to header on every request? I ask because the application I'm building is an SPA and it seems easier just to do the cookie -> request header way.EJC– EJC2018-11-30 15:26:59 +00:00Commented Nov 30, 2018 at 15:26
- @EJC Your application should not put the anti-CSRF token into the cookies. The way CSRF tokens work is: the server outputs it directly into the html (hidden form field) in every response which has a form. How would an attacker hijack a session if he doesn't have access to the JWT? The JWT is for authentication. The anti-CSRF-token is only for CSRF-protection.Martin Fürholz– Martin Fürholz2018-11-30 16:25:53 +00:00Commented Nov 30, 2018 at 16:25
- Well with a CSRF attack you don't need access to the JWT, it is stored in the browser and its automatically sent with the request. This, in combination with getting the anti-csrf token with XSS, should be enough to hijack the session.EJC– EJC2018-11-30 22:47:06 +00:00Commented Nov 30, 2018 at 22:47
| Show 2 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. web-application), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you