DEV Community

Discussion on: RESTful Security: Plug the Leaks!

Collapse
 
sokolovdenis profile image
Denis Sokolov

Maybe "more RESTFully" logic may be:
return 401 if user unauthenticated (it's does not matter exists account or not);
return 403 if user authenticated but is not owner of requested account (it's does not matter exists account or not);
return 404... I think never :)

Collapse
 
sqlrob profile image
Robert Myers

That has the exact same problem as 401 / 404, it just requires the the additional step of registering. There is little to no security gain.

Collapse
 
sokolovdenis profile image
Denis Sokolov

If there is no authentication in API, and we want to protect our growth rate statistics - yes, same problem exists. And GUID instead of INT identifiers may help.

Thread Thread
 
sqlrob profile image
Robert Myers

Even if there is authentication in API, it doesn't matter. (See Panera's "fix")

GUID or other unpredictable identifier is the only real fix. Rate limiting each user can help as well, but how useful that is really depends on how hard it is to get authentication tokens.

Collapse
 
dshearer profile image
C. Dylan Shearer

That certainly makes sense.