为什么我们需要对 Web 应用程序进行服务器端和客户端验证? [英] Why do we need server side as well as client side validation for Web applications?

查看:45
本文介绍了为什么我们需要对 Web 应用程序进行服务器端和客户端验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何高级理由同时对 Web 应用程序进行客户端和服务器端验证?

Is there any high level reason to have both client side and server side validations for a web application ?

推荐答案

因为你的客户端验证可能会被颠覆.

Because your client side validation may be subverted.

例如 - 在网络上,如果您使用 javascript 进行验证,那么关闭 javascript 或使用 FireBug 等工具更改其工作方式非常容易.

For example - on the web, if you are using javascript for validation, it is very easy to either turn javascript off, or change how it works using tools such as FireBug.

与其他客户端/服务器方法一起发生的事件,可能会破坏数据链接,并且可以在到服务器的途中更改已验证"数据(中间人 攻击).

Event with other client/server methods, it is possible for the data link to be subverted and the "validated" data can be changed on the way to the server (Man In The Middle attack).

一般来说,永远不要信任客户端"是您需要始终在服务器上进行验证的原因.

In general, the maxim "never trust the client" is the reason that you need to always validate on the server.

在这种情况下,您可能会问,为什么要在客户端进行验证?为了提供即时反馈.

You may ask in that case, why validate on the client? In order to provide immediate feedback.

这篇关于为什么我们需要对 Web 应用程序进行服务器端和客户端验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆