-
Notifications
You must be signed in to change notification settings - Fork 10
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
protect UI API calls with POST/csrf #299
Comments
TODO: idedntify relevant endpoints |
@joefutrelle ifcbdb/ifcbdb/dashboard/urls.py Line 103 in 333374e
Same for the admin area: Line 20 in 333374e
Just a heads up that this will take some time to switch out. I spot checked a few of the dashboard URLs, and some of them are called from multiple locations in the code, and definitely using GET. So while fixing any particular endpoint is trivial, the time consuming part will be tracking down all the uses of that url and testing |
Agreed that this is not necessary for all endpoints and not essential for many of them. So I will identify the ones to target and we can just do those for now. My criteria are
I think this will be a reasonably small subset of the API endpoints. In the next round we would protect all API endpoints that aren't appropriate to be called from an external script but really only support the UI. |
@joefutrelle I finished up the conversion of all the items that start with /api, minus about 4 of them that I think should remain as GETS (image links mostly). All changes are in the below PR. As mentioned in Slack, I've done the conversion AND tried to locate and test all instances where those methods are called, and everything looks good as far as I can tell Updated Files |
Right now we have GET API calls that users can call from non-browser clients, and some of them are expensive. For endpoints that are just used for the UI, they should be POSTs that require a csrf token.
The text was updated successfully, but these errors were encountered: