使用Jquery / Javascript保护应用程序 [英] Secure the Application using Jquery/Javascript

查看:73
本文介绍了使用Jquery / Javascript保护应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



如何使用Jquery或java脚本保护我们的Web应用程序。



如果我们通过java脚本连接到数据库。这是否安全?

Hi All,

How we can secure the our web Application by using Jquery or java script.

and if we connected to data base through java script. is this Secure or not?

推荐答案

黑客可以完全更改/删除客户端上的所有内容(包括html和javascript)。出于这个简单的原因,将你的防线放入客户端javascript将是荒谬的。您只能在服务器端保护应用程序:确保服务器端代码的公共接口不会以任何方式从客户端滥用。换句话说:确保我不能向您的服务器端代码发出一个邪恶的制作请求(带有花哨的参数)(例如使用我的邪恶python脚本),这样它就会采取您不希望作为其所有者的操作。 site:例如:

- 通过从您的数据库或站点发送敏感信息来响应我的python脚本

- 对您的数据库造成损害(sql注入) - 比如删除表格或条目

....



在您的客户端脚本和HTML中,您必须确保:

- 它按预期工作(化妆品)

- 它不会显示有关服务器端代码的可利用信息
Everything that is on the client side (including html and javascript) can be completely changed/removed by a hacker. For this simple reason putting your defense lines into client-side javascript would be ridiculous. You can secure your application only on the server side: Make sure that the public interface of your server side code can not be abused in any way from the client side. In other words: Make sure that I can not issue an evil crafted request (with fancy parameters) to your server side code (for example with my evil python script) so that it takes an action you don't want as the owner of the site: for example:
- responding to my python script by sending sensitive info from your db or site
- making damage to your db (sql inject) - like deleting a table or entries
....

In your client side script and html you have to make sure that:
- it works as intended (cosmetics)
- it doesn't reveal exploitable info about your server side code


这篇关于使用Jquery / Javascript保护应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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