如何在Angular应用中修复可能的XSS漏洞
我使用Veracode平台分析某些项目。我目前在Angular中有一个项目。我的应用程序中有一个选择列表。
Veracode告知,通过选择一个选项,可以执行称为XSS的恶意JavaScript。由于有许多XS有效载荷,最简单的JavaScript注射不起作用,因此我需要经验丰富的开发人员的输入。
这是我的代码:
<kendo-treeview
class="po-md-12 po-mt-1 po-mb-1"
kendoTreeViewDragAndDrop
kendoTreeViewDragAndDropEditing
kendoTreeViewExpandable
[expandBy]="'id'"
[(expandedKeys)]="expandedKeys"
kendoTreeViewHierarchyBinding
[childrenField]="'children'"
[(nodes)]="treeviewItems"
[textField]="'name'"
kendoTreeViewSelectable
[(selectedKeys)]="selectedKeys"
(nodeDrop)="handleDrop($event)"
(removeItem)="handleRemovedNode()"
(selectionChange)="handleSelection($event)"
[selectBy]="'id'"
[isSelected]="isItemSelected"
>
脆弱的行是:
(selectionChange)="handleSelection($event)"
是否可以在此代码中运行JavaScript或利用XSS?由于有许多JavaScript有效载荷可以利用XSS漏洞,因此无法注入JavaScript来利用XSS?
I use the Veracode Platform to analyze some projects. I currently have a project in Angular. I have a select list in my application.
Veracode informs that by selecting an option it is possible to execute a malicious JavaScript, called XSS. As there are many XSS payloads and the simplest JavaScript injections don't work, I need input from more experienced developers.
This my code:
<kendo-treeview
class="po-md-12 po-mt-1 po-mb-1"
kendoTreeViewDragAndDrop
kendoTreeViewDragAndDropEditing
kendoTreeViewExpandable
[expandBy]="'id'"
[(expandedKeys)]="expandedKeys"
kendoTreeViewHierarchyBinding
[childrenField]="'children'"
[(nodes)]="treeviewItems"
[textField]="'name'"
kendoTreeViewSelectable
[(selectedKeys)]="selectedKeys"
(nodeDrop)="handleDrop($event)"
(removeItem)="handleRemovedNode()"
(selectionChange)="handleSelection($event)"
[selectBy]="'id'"
[isSelected]="isItemSelected"
>
The vulnerable line is this:
(selectionChange)="handleSelection($event)"
Is it possible to run a JavaScript or exploit XSS in this code? As there are many JavaScript payloads to exploit XSS vulnerabilities, it is not possible to inject JavaScript to exploit XSS?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论