Strategy Web allows HTML output on selectors. Prior to Strategy 2021 Update 3, you could insert any HTML to the selector. Starting in Strategy 2021 Update 3, OWASP-Java-Html-Sanitizer is used to smartly encode, instead of not encoding at all. This change is introduced to tighten Strategy security standards. Some elements and attributes like
<target=“popup”>will be filtered by OWASP-Java-Html-Sanitizer due to security concerns.
<MSTR WEB>\WEB_INF\xmlfolder.
sys_defaults.propertiesIf it does not exist, create one.
allowHTMLOnSelector=1
<MSTR WEB>\WEB_INF\xmlfolder.
sys_defaults.propertiesIf it does not exist, create one.
htmlSanitizerFileLocation=WEB-INF/xml/htmlSanitizerConfig.json
<MSTR WEB>\WEB_INF\xmlfolder, add the customized sanitizer policies to the
htmlSanitizerConfig.jsonfile.
htmlSanitizerConfig.json. For example:
{
"allowStyling": [
"display"
]
}
] htmlSanitizerConfig.jsonto allow them.
[
{
"allowElements": ["a"],
"allowAttributesObject": {
"allowAttributes": ["target", "onclick"],
"onElements": ["a"],
"globally": false
}
}
] “allowStyling”: Allows the named CSS styling.
"allowElements": Allows the named elements.
"allowAttributesObject": Returns an object that lets you associate policies with the given attributes, and allow them globally or on specific elements.
"globally"and
"onElements": Allows the attribute for all elements- set
"globally": true. Otherwise, input the elements inside
"onElements".
"allowTextIn": Allows text content in the named elements.
"allowWithoutAttributes": Assuming the given elements are allowed, allows them to appear without attributes.
htmlSanitizerConfig.jsoncontent.
"span"without any attributes:
<span></span>
[
{
"allowElements": ["span"],
"allowWithoutAttributes": ["span"]
}
] "class"attribute on any elements globally.
[
{
"allowAttributesObject": {
"allowAttributes": ["class"],
"onElements": [""],
"globally": true
}
}
]