Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

confirm未对显示内容过滤防止xss攻击 #8532

Open
x412773090 opened this issue May 6, 2024 · 1 comment
Open

confirm未对显示内容过滤防止xss攻击 #8532

x412773090 opened this issue May 6, 2024 · 1 comment

Comments

@x412773090
Copy link

Reproduction link

https://ng-zorro-antd-ivy-cjm9xv.stackblitz.io

Steps to reproduce


import { Component } from '@angular/core';
import { NzModalService } from 'ng-zorro-antd/modal';

@Component({
  selector: 'my-app',
  template: `
    <input nz-input [(ngModel)]="input">

    <button 
      (click)="openConfirm()"
      nz-button
      type="button">confirm</button>
  `,
})
export class AppComponent {
  input = 'delete [<a href="https://bing.com">link</a>] ?';

  constructor(private nzModalService: NzModalService) {}

  openConfirm(): void {
    this.nzModalService.confirm({
      nzTitle: this.input,
    });
  }
}

What is expected?

链接不可被点击

What is actually happening?

点击链接可跳转到外部网站

Environment Info
ng-zorro-antd 17.4.0
Browser chrome
Copy link

zorro-bot bot commented May 6, 2024

Translation of this issue:

Confirm does not use the display content filtering to prevent XSS attacks

REPRODUCTION LINK

[https://ng-zorro-mtd- ivy-cjm9xv.stackblitz.io] (https://ng-zorro-ntd-Ivy-cjm9xv.stackblitz.io))))))))

STEPS To Reproduce

`` Text

Import {component} from '@angular/core';
import {nzmodalService} from 'ng-zorro -NTD/MODAL';

@component ({{
Selector: 'My-APP',
template: `
<input nz-input [(ngmodel)] = "input">

<Button
  (click) = "OpenConfirm ()" "
  nz-button
  Type = "Button"> Confirm </Button>

`,
})
export class appcomponent {
input = 'delete [ link ]?';

Constructionor (Private NzmodalService: NZMODALSERVICE) {}

OpenConfirm (): void {
this.nzmodalService.confirm ({
nztitle: this.input,
});
}
}
`` `

What is exfected?

The link cannot be clicked

What is actually happy?

Click the link to jump to the external website

| ENVIRONMENT | Info |
| --- | --- | |
| NG-Zorro-ATD | 17.4.0 |
| Browser | Chrome |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant