AJAX安全问题 [英] AJAX security questions

查看:100
本文介绍了AJAX安全问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望清除一些有关AJAX安全性的问题.因此,这是我想缠住头的情况.

I was hoping to clear up some questions I have been having with AJAX security. So here is a scenario I am trying to wrap my head around.

让我们说我正在使用AJAX向页面请求一些半敏感的材料.例如,我将把用户的ID传递给php文件,并返回有关他们自己的一些信息.现在,是什么阻止某人模仿此Javascript请求,并将不同的ID传递给PHP脚本?

Lets say I am using AJAX to request some semi-sensitive material to the page. For instance, I am going to pass the user's ID to a php file, and return some information about themselves. Now, what is keeping someone from emulating this Javascript request, and passing different ID's to the PHP script?

  • 服务器是否有任何措施可以阻止这种情况发生?
  • DOM是否能够识别原始"位置的Java脚本,
    还是由服务器编写,而不是客户端Javascript?
  • 使用AJAX请求敏感材料时还有哪些其他安全问题?
  • 我正在使用suPHP,在这样的情况下这有影响吗?

推荐答案

Ajax调用与您发出的任何其他HTTP请求完全相同,除了它是异步的(不会重新加载Web浏览器).因此,您应该使用当前在网站上使用的任何身份验证.

An Ajax call is exactly identical to any other HTTP request that you make except that it's asynchronous (it doesn't reload the web browser). So you should be using whatever authentication you currently employ on your web site.

这可能是Windows集成的安全性,Cookie等.基本上,您的PHP脚本只需要验证请求是否来自应用程序的有效用户即可.

This could either be Windows integrated security, cookies, etc. Basically your PHP script just has to verify that the request is coming from a valid user of your application.

这篇关于AJAX安全问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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