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

Should support returning a prefix to avoid JSON hijacking on GET requests. #14

Open
JulianBirch opened this issue Aug 20, 2013 · 4 comments

Comments

@JulianBirch
Copy link

No description provided.

@dyba
Copy link

dyba commented Apr 11, 2014

Can you explain what you mean by this @JulianBirch ?

@weavejester
Copy link
Member

See JSON hijacking for a detailed explanation of this attack.

The author of this issue is proposing that we add an configurable prefix so a user can add something like while(1); to the beginning of their JSON.

@JulianBirch
Copy link
Author

Exactly. On a related note, it's worth considering whether secure should be the default. I've got the same problem with cljs-ajax: secure by default is a good idea, but it would be a horribly breaking change.

@weavejester
Copy link
Member

Adding a prefix is only necessary if the endpoint is using cookies for verification and returns an array. For standalone APIs or AJAX interfaces that use tokens, or for endpoints that return anything but an array, a prefix is unnecessary and something of a hindrance.

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

No branches or pull requests

3 participants