The xss rules configuration provides details about what tags and attributes are accepted and rejected in the input data.
Import rules from different files
The xss-rules can be written in multiple files and can be imported to the main configuration file using the <import> tag and the file name as the name of the file in the classpath, and name of the xss-rules section in that imported file. Each imported file has the xss-rules same as those explained in this section.
This indicates that the "id" attribute can be accepted for any tag except the script tag.
The value of the attribute can be restricted with the multiple regular expressions given below. If there are no regular expressions defined, then the attribute is accepted irrespective of its value.
The above configuration indicates that the align attribute should be accepted for any tag, but the value of the attribute must be center, left or right only.
Note: The value of the <regexp> must be a valid java regular expression.
Accept tags
Which tags should be accepted in configuration for input data is defined using <accept-tag>.
For example:
<accept-tag name="b">
</accept-tag>
The above rule says that the "b" bold tag can be accepted.
Tag specific attribute: Each accept tag does allow multiple attributes that can be allowed for that tag only is given below.
Note: Go through the following files for more information on what tags and what attributes are accepted or rejected. conf\resources\conf\bmwebsecurity\bmxsshtml4rules.xml conf\resources\conf\bmwebsecurity\xss-html4-standard-rules.xml
Important: The recommended approach is to add accept or reject rules through the bmxssconfig.xml rather than modifying the above files.