I have application where customer can store following html lines in order to load different styles for actual browser:
<!--[if IE 6]><link rel="stylesheet" type="text/css" media="all" href="default/css/general_ie6.css"><![endif]-->
<!--[if IE 7]><link rel="stylesheet" type="text/css" media="all" href="default/css/general_ie7.css"><![endif]-->
<!--[if IE 8]><link rel="stylesheet" type="text/css" media="all" href="default/css/general_ie8.css"><![endif]-->
Also I've configured OWASP policy
to disallow malicious html tags in following way:
new HtmlPolicyBuilder().allowElements("link").allowAttributes("rel", "type", "media", "href").onElements("link").toFactory();
But after sanitation if browser lines
are dropped.
Could you please suggest how to configure policy in order to allow storing such content?