Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XSS security issue on delete links #21

Closed
almet opened this issue Aug 21, 2011 · 3 comments
Closed

XSS security issue on delete links #21

almet opened this issue Aug 21, 2011 · 3 comments
Labels
Milestone

Comments

@almet
Copy link
Member

almet commented Aug 21, 2011

Delete should use POST, not GET (For members, expenses and projects), to avoid XSS attacks.

@fredericsureau
Copy link
Contributor

Can you explain why using POST instead of GET would avoid XSS attacks?

@almet
Copy link
Member Author

almet commented Jan 27, 2012

I thought that the browsers prevented one website to do POSTs from other websites and that it wasn't the case with GET calls (because there is no reason to do so).

Using the HTTP specified usage for GET and POST, in which GET requests never have a permanent effect, is good practice but is not sufficient to prevent CSRF. Attackers can write JavaScript or ActionScript that invisibly submits a POST form to the target domain. However, filtering out unexpected GETs prevents some particular attacks, such as cross-site attacks using malicious image URLs or link addresses and cross-site information leakage through script elements (JavaScript hijacking); it also prevents (non-security-related) problems with aggressive web crawlers and link prefetching.

http://en.wikipedia.org/wiki/Cross-site_request_forgery#Prevention (a lot of useful information in there)

So I guess we can do a POST and generate unique tokens valid for only one call, and pass it along with the form we send.

@fredericsureau
Copy link
Contributor

Okay for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants