如何解决DOM XSS - 这真的可以利用吗?
CheckMarx 发现了这一点并将其标记为漏洞。它似乎不依赖于用户输入,所以我很好奇这是否真的可以利用。这是通过拖动组件来激活的。如果这实际上是可利用的,是否有修复建议?
CheckMarx 是这样说的:
应用程序的 this.componentsArray.forEach 嵌入了不受信任的数据 在带有位置的生成输出中。这个不受信任的数据被嵌入 直接进入输出,无需适当的清理或编码, 使攻击者能够将恶意代码注入到输出中。
public handleDragOverTouch(e: TouchEvent) {
let x = e.changedTouches[0].clientX;
let y = e.changedTouches[0].clientY;
let componentBeingDragged = this.componentsArray.find(child => child.instance.componentConfig.id === this.draggedId);
if (componentBeingDragged !== null && componentBeingDragged !== undefined) {
this.componentsArray.forEach(component => {
let childLocation = component.location.nativeElement.getBoundingClientRect();
if (y > childLocation.top && y < childLocation.bottom && x > childLocation.left && x < childLocation.right) {
this.handleDrag(null,component.location,component.instance.componentConfig.id,x);
}
});
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。