Skip to content

Commit b413032

Browse files
committed
test(security): pin CVE-2023-42399 payload — javascript: iframe src is stripped (#1017)
1 parent 17e8f8a commit b413032

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/tests/acceptance/security.test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@
77
describe('Security test', () => {
88
describe('XSS', () => {
99
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+
1024
describe('Set HTML with onerror JS', () => {
1125
it('Should remove this unsafe attribute', () => {
1226
const editor = getJodit();

0 commit comments

Comments
 (0)