Why is client-side validation a security risk as opposed to server-side validation?

前端 未结 5 513
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-09 12:23

I don\'t quite understand why client side validation is a potential security risk or more of a security risk than server side validation? Can someone give me some scenarios

5条回答
  •  时光说笑
    2020-12-09 13:20

    I assume you're talking about a web scenario?

    If you're doing client side validation with Javascript, what happens if the user has Javascript disabled? Then they can submit data to the server that has not been validated.

    If they were sneaky, they could even post data directly to your server (bypassing your page completely).

    If you do server side validation, in addition to or instead of client side validation, then you have an additional opportunity to defend against these scenarios.

提交回复
热议问题