diff --git a/cypress/integration/other/xss.spec.js b/cypress/integration/other/xss.spec.js index 842eab36f..fb052d171 100644 --- a/cypress/integration/other/xss.spec.js +++ b/cypress/integration/other/xss.spec.js @@ -63,5 +63,10 @@ describe('XSS', () => { cy.wait(1000); cy.get('#the-malware').should('not.exist'); }) + it('should not allow maniplulating antiscript to run javascript using onerror', () => { + cy.visit('http://localhost:9000/xss6.html'); + cy.wait(1000); + cy.get('#the-malware').should('not.exist'); + }) }) diff --git a/cypress/platform/xss6.html b/cypress/platform/xss6.html new file mode 100644 index 000000000..dcc9f8652 --- /dev/null +++ b/cypress/platform/xss6.html @@ -0,0 +1,97 @@ + + + + + + + + + +
Security check
+
+
+
+ + + + + diff --git a/src/diagrams/common/common.js b/src/diagrams/common/common.js index 885f350de..0de97b269 100644 --- a/src/diagrams/common/common.js +++ b/src/diagrams/common/common.js @@ -27,8 +27,9 @@ export const removeScript = txt => { } } - rs = rs.replace('javascript:', '#'); - rs = rs.replace('