通过客户端脚本请求网站= Cross Side Scripting Hack。但是通过服务器端脚本请求网站不是一个黑客!为什么? [英] Requesting a website by client side script = Cross Side Scripting Hack. But requesting a website by server side script is not a hack! Why?

查看:88
本文介绍了通过客户端脚本请求网站= Cross Side Scripting Hack。但是通过服务器端脚本请求网站不是一个黑客!为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,当我们想在同一页面中显示某个网页的内容时,我们会查找ajax请求。如果说,我使用AJAX向不同域中的网页请求,则由于跨侧脚本错误而不允许这样做。但是为什么允许通过服务器端页面进行访问。对于例如我们可以在php中使用CURL来访问任何网站。为什么这个功能适用于服务器端脚本而不适用于客户端脚本?

Generally, when we want to show the contents of some web page in the same page, we go for ajax requests. If say, I request to a web page in different domain with AJAX, it is not allowed because of the Cross side scripting error. But why is it allowed to access via a server side page. For e.g. we can use CURL in php to access any site.? Why is this feature OK for server side scripting and NOT OK for Client Side Scripting?

推荐答案

因为恶意脚本可以打开外部脚本页面没有用户的提交。例如,想象一个不安全的文本区域。如果向其他用户显示此文本框的内容,则该文本框的内容可能包含连接到远程主机的脚本,并向其发送敏感用户信息。这一切归结为:服务器端 - >你在控制,客户端 - >公共,所以容易被滥用。

Because a malicious script can open an external page without the premission of the user. For instance imagine an insecure textarea. If the contents of this textbox is shown to other users it might contain a script that connects to a remote host and sends sensitive user info to it. It all boils down to: server-side -> you are in control, client-side -> public, so prone to abuse.

这篇关于通过客户端脚本请求网站= Cross Side Scripting Hack。但是通过服务器端脚本请求网站不是一个黑客!为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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