diff --git a/cypress/integration/other/xss.spec.js b/cypress/integration/other/xss.spec.js index 830be4f8e2..842eab36fa 100644 --- a/cypress/integration/other/xss.spec.js +++ b/cypress/integration/other/xss.spec.js @@ -58,5 +58,10 @@ describe('XSS', () => { cy.wait(1000); cy.get('#the-malware').should('not.exist'); }) + it('should not allow maniplulating antiscript to run javascript', () => { + cy.visit('http://localhost:9000/xss5.html'); + cy.wait(1000); + cy.get('#the-malware').should('not.exist'); + }) }) diff --git a/cypress/platform/xss5.html b/cypress/platform/xss5.html new file mode 100644 index 0000000000..9d3ad4da67 --- /dev/null +++ b/cypress/platform/xss5.html @@ -0,0 +1,99 @@ + + + + + + + + + +
Security check
+
+
+
+ + + + + diff --git a/src/diagrams/common/common.js b/src/diagrams/common/common.js index 4e26efca8c..885f350de8 100644 --- a/src/diagrams/common/common.js +++ b/src/diagrams/common/common.js @@ -26,6 +26,10 @@ export const removeScript = txt => { break; } } + + rs = rs.replace('javascript:', '#'); + rs = rs.replace('