3 ms·
Not sure I agree with this part: > Allow all GET, HEAD, or OPTIONS requests. > These are safe methods, and are assumed not to change state at various layers o
by MajesticHobo2 1y ago
Not sure I agree with this part:
> Allow all GET, HEAD, or OPTIONS requests.
> These are safe methods, and are assumed not to change state at various layers of the stack already.
Plenty of apps violate this assumption and do allow GET requests to alter state.
- chrisfosterelli 1y agoIMO apps that do this have a bug, and possibly a security one. This causes issues with prefetching, bot traffic, caching, CSRF, and just plain violates HTTP standards.
- pstuart 1y agoAgreed. Those methods should be treated as idempotent.
- pinoy420 1y agoNot really. If I have a service where I need one click to perform an action and store data. It has to be a GET. You can’t post from a url… purist dogma for the sake of purist dogma
- FireInsight 1y agoOne click to perform an action and store data? Have you heard of HTML forms with method="post"?
- whatabtemaillnk 1y ago[dead]
- simonw 1y agoThose apps are beyond helping already. They need to fix theselves.
- nchmy 1y agoThe entire WordPress ecosystem says hello
- cryptonector 1y agoThis is on the server side, on the app. If your supposedly-safe methods aren't safe, then CSRF may not be your biggest problem.
- paulhodge 1y agoThat’s bad because visiting an evil site can easily trick your browser into performing one of those requests using your own credentials. CORS doesn’t stop the backend state effect from happening.
- MajesticHobo2 1y agoThat's exactly why I don't agree that GETs should be broadly exempted from CSRF protections. I'm not talking about CORS at all.
- motorest 1y ago> Plenty of apps violate this assumption and do allow GET requests to alter state. Yeah, that's not a justification. From a RESTful API design perspective, this just means plenty of apps are buggy/critical design problems. A bug in a random app does not mean HTTP verb lose their semantics.