mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-07 01:26:42 +02:00
test: Verify label is sanitized
Co-authored-by: Chris Grieger <chris@scolp.de>
This commit is contained in:
@@ -152,4 +152,15 @@ describe('XSS', () => {
|
|||||||
cy.wait(1000);
|
cy.wait(1000);
|
||||||
cy.get('#the-malware').should('not.exist');
|
cy.get('#the-malware').should('not.exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should sanitize labels', () => {
|
||||||
|
const str = JSON.stringify({
|
||||||
|
code: `erDiagram
|
||||||
|
"<img src=x onerror=xssAttack()>" ||--|| ENTITY2 : "<img src=x onerror=xssAttack()>"
|
||||||
|
`,
|
||||||
|
});
|
||||||
|
imgSnapshotTest(utf8ToB64(str), {}, true);
|
||||||
|
cy.wait(1000);
|
||||||
|
cy.get('#the-malware').should('not.exist');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user