There was an error while loading. Please reload this page.
1 parent 17e8f8a commit b413032Copy full SHA for b413032
1 file changed
test/tests/acceptance/security.test.js
@@ -7,6 +7,20 @@
7
describe('Security test', () => {
8
describe('XSS', () => {
9
describe('From source', () => {
10
+ describe('Set iframe with javascript: src (CVE-2023-42399)', () => {
11
+ it('Should strip the unsafe src attribute', () => {
12
+ const editor = getJodit();
13
+
14
+ editor.value =
15
+ '<iframe src="JavaScript: alert(/xss/)"></iframe><p>ok</p>';
16
17
+ const iframe = editor.editor.querySelector('iframe');
18
+ const src = iframe && iframe.getAttribute('src');
19
20
+ expect(/javascript:/i.test(src || '')).is.false;
21
+ });
22
23
24
describe('Set HTML with onerror JS', () => {
25
it('Should remove this unsafe attribute', () => {
26
const editor = getJodit();
0 commit comments