There are known XSS attacks like:
<DIV STYLE="color: red; width: expression(alert('XSS')); background-image: url('expression.png') ">
Or
<DIV STYLE="background-image: url(javascript:alert('XSS')); border-image: url(images/javascript.png) 30 round round;">
Or
<META HTTP-EQUIV=Refresh CONTENT="1; URL=javascript:alert(/xxs/.source)">empty
And i need to sanitize html to this:
<DIV STYLE="color: red; background-image: url('expression.png') ">
Or
<DIV STYLE="border-image: url(images/javascript.png) 30 round round;">
Or
empty
Is there java library, that provide such protections?