Skip to content
Advertisement

How can prevent Stored XSS by iframe?

I use Extjs and JS to build a dialog where can display my html data from DB, that data is wrapped with iframe like this:

JavaScript

I tried to add sandbox to iframe, but it doesn’t work, the XSS alert still show.

  • Then I tried to change to <iframe src='#'... sandbox>, but XSS alert still show.
  • I removed src or just set it '' in <iframe src=''... sandbox>, it got this error: DOMException: Blocked a frame with origin "mytestdomain" from accessing a cross-origin frame.

What should I do to handle my issue?

Thanks a lot for any help.

Advertisement

Answer

The issue is fixed by set “allow-same-origin” for sandbox

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement