Cross-site scripting

Cross-site scripting (XSS) is a type of computer security vulnerability typically found in Web applications. XSS enables attackers to inject client-side script into Web pages viewed by other users. A cross-site scripting vulnerability may be used by attackers to bypass access controls such as the same origin policy. Cross-site scripting carried out on websites accounted for roughly 84% of all security vulnerabilities documented by Symantec as of 2007.[1] Their effect may range from a petty nuisance to a significant security risk, depending on the sensitivity of the data handled by the vulnerable site and the nature of any security mitigation implemented by the site‘s owner.

In computing, the same-origin policy is an important concept in the web application security model. The policy permits scripts running on pages originating from the same site – a combination of scheme, hostname, and port number[1] – to access each other‘s DOM with no specific restrictions, but prevents access to DOM on different sites.[1] The same-origin policy also applies to XMLHttpRequests unless the server provides an Access-Control-Allow-Origin (CORS) header. Notably, WebSockets are not subject to the same-origin policy.

This mechanism bears a particular significance for modern web applications that extensively depend on HTTP cookies to maintain authenticated user sessions, as servers act based on the HTTP cookie information to reveal sensitive information or take state-changing actions. A strict separation between content provided by unrelated sites must be maintained on the client side to prevent the loss of data confidentiality or integrity.

时间: 2024-11-09 06:56:49

Cross-site scripting的相关文章

XSS 跨站脚本攻击(Cross Site Scripting)

xss表示Cross Site Scripting(跨站脚本攻击),它与SQL注入攻击类似,SQL注入攻击中以SQL语句作为用户输入,从而达到查询/修改/删除数据的目的,而在xss攻击中,通过插入恶意脚本,实现对用户游览器的控制. xss攻击可以分成两种类型: 非持久型攻击 持久型攻击 下面我们通过具体例子,了解两种类型xss攻击. 1.非持久型xss攻击 顾名思义,非持久型xss攻击是一次性的,仅对当次的页面访问产生影响.非持久型xss攻击要求用户访问一个被攻击者篡改后的链接,用户访问该链接时

XSS (Cross Site Scripting) Prevention Cheat Sheet(XSS防护检查单)

本文是 XSS防御检查单的翻译版本 https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet 介绍 本文描述了一种恰当地使用输出转码或者转义(encoding or escaping)防御XSS攻击的简单积极模式. 尽管存在巨量XSS攻击方式,遵守一些简单的规则能够彻底防住这类严重的攻击. 本文不探讨XSS攻击的商业和技术影响. reflected and stored XSS 可以

xss (Cross Site Scripting)跨站脚本攻击

XSS攻击:跨站脚本攻击(Cross Site Scripting),为不和层叠样式表(Cascading Style Sheets, CSS)的缩写混淆,故将跨站脚本攻击缩写为XSS. XSS攻击分成两类: 一类是来自内部的攻击,主要指的是利用程序自身的漏洞,构造跨站语句,如:dvbbs的showerror.asp存在的跨站漏洞. 另一类则是来自外部的攻击,主要指的自己构造XSS跨站漏洞网页或者寻找非目标机以外的有跨站漏洞的网页.如当我们要渗透一个站点,我们自己构造一个有跨站漏洞的网页,然后构

DVWA 黑客攻防实战(十)反射型 XSS 攻击 Reflected Cross Site Scripting

XSS (Cross-site scripting) 攻击,为和 CSS 有所区分,所以叫 XSS.又是一种防不胜防的攻击,应该算是一种 "HTML注入攻击",原本开发者想的是显示数据,然而攻击者输入却是有破坏性的代码,而且能被解析执行.Symantec在2007年报告更是指出跨站脚本漏洞大概占所有网站漏洞的84%. XSS 大致分成三种类型(白帽子说安全): 反射型,就是本文的内容. 存储型,在这篇文章会介绍. DOM 型,如果用是否会存储在服务器上区分的话,DOM型也是反射型.但比

防止恶意代码注入XSS(cross site scripting)

Login.PHP页面 <!DOCTYPE html> <html> <head> <title>登录页面</title> <meta http-equiv="content-type" content="text/html;charset=utf-8"/> </head> <body> <form action="LoginController.php&

RailsCase27 Cross Site Scripting 跨站点脚本攻击

跨站点脚本是开发过程中经常需要考虑的安全问题.此种情形发生在允许用户直接输入html.javascript脚本时.在下述的website中,我们并没有过滤输入的内容,导致一些安全漏洞. 如果在输入框中输入由<script>包围的内容,当页面被加载的时候,脚本将被执行,每次均将在前端展示.例如,如果输入<script>alert('hello')</script>并保存,每次浏览此页面时,都将看到alert的窗口. 嵌入页面的javascript脚本如下: termina

XSS(Cross Site Script)

类型一:反射型XSS 简单地把用户输入的数据“反射”给浏览器.也就是说,黑客需要诱使用户“点击”一个恶意链接,才能攻击成功. 类型二:存储型XSS 把用户输入的数据“存储”在服务器端.这种XSS具有很强的稳定性. 类型三:DOM Based XSS 通过修改页面DOM节点形成的XSS,称之为DOM Based XSS. XSS Payload: XSS攻击成功后,攻击者能够对用户当前浏览的页面植入恶意脚本,通过恶意脚本,控制用户的浏览器.这些完成各种具体功能的恶意脚本,被称为”XSS Paylo

百度地图引用报错A parser-blocking, cross site (i.e. different eTLD+1) script

百度地图引入首先要申请ak哈.这个网上很多东西. 自己遇到的是一个警告,看到控制台有东西就不爽,强迫症,看图: <script src="http://api.map.baidu.com/api?v=2.0&ak=bUqWGO221Psm3MKPP3a7dKW7SepaA"></script> 反正后面一大串,这个在控制台很难看,虽然不影响效果. 解决办法: <script src="http://api.map.baidu.com/ge

What technical details should a programmer of a web application consider before making the site public?

What things should a programmer implementing the technical details of a web application consider before making the site public? If Jeff Atwood can forget about HttpOnly cookies, sitemaps, and cross-site request forgeries all in the same site, what im

Cross-site Scripting (XSS) 阅读笔记

本文源自 https://www.owasp.org/index.php/Cross-site_Scripting_%28XSS%29 通过阅读和翻译,并按照自己的理解,整理成如下文档. 概述 XSS攻击是一种注入, 通过这种攻击,恶意脚本被注入到被信任的网站里. XSS攻击的表现是,攻击者使用web应用的缺陷,发送恶意代码到另外一个不同用户, 一般是以浏览器端脚本的形式发送. 这种使得攻击成功的缺陷是相当广泛的,并存在于这种web应用中, 应用使用用户输入数据,放到网站输出的响应中,但是没有对