Should I obscure primary key values?

后端 未结 10 2209
借酒劲吻你
借酒劲吻你 2021-02-13 02:33

I\'m building a web application where the front end is a highly-specialized search engine. Searching is handled at the main URL, and the user is passed off to a sub-directory wh

10条回答
  •  春和景丽
    2021-02-13 03:10

    URLs that include an identifier will let you down for three reasons.

    Wrong, wrong, wrong.

    First - every request has to be validated, regardless of it coming in the form of a HTTP GET with an id, or a POST, or a web service call.

    Second - a properly made web-site needs protection against bots which relies on IP address tracking and request frequency analysis; hiding ids might stop some people from writing a shell script to get a sequence of objects, but there are other ways to exploit a web site by using a bruteforce attack of some sort.

    Third - ICQ ids are valuable but only because they're related to users and are a user's primary means of identification; it's a one-of-a-kind approach to user authentication, not used by any other service, program or web-site.

    So, to conclude.. Yes, you need to worry about scrapers and DDOS attacks and data protection and a whole bunch of other stuff, but hiding ids will not properly solve any of those problems.

提交回复
热议问题