简体   繁体   English

XSS漏洞

[英]XSS vulnerability

I got the below error when I testing my mobile application. 测试我的移动应用程序时出现以下错误。 How can i resolve this XSS error? 我该如何解决这个XSS错误?

The value of the q request parameter is copied into the HTML document as plain text between tags. q request参数的值将作为标记之间的纯文本复制到HTML文档中。 The payload 2906f<script>alert(1)</script>b08ffac3085 was submitted in the q parameter. 有效负载2906f<script>alert(1)</script>b08ffac3085在q参数中提交。 This input was echoed unmodified in the application's response. 该输入在应用程序的响应中未做任何修改。

This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. 这种概念验证攻击表明,可以向应用程序的响应中注入任意JavaScript。

You encode it for HTML before you put it in the HTML document. 您先将其编码为HTML,然后再将其放入HTML文档。

With JavaScript (since that is the only language you've mentioned), that generally means using createTextNode instead of innerHTML . 使用JavaScript(因为这是您提到的唯一语言),通常意味着使用createTextNode而不是innerHTML

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM