mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-10-31 10:54:15 +01: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.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
	 Sidharth Vinod
					Sidharth Vinod