Configure to enable protection against cross-site scripting (XSS) attacks

Feedback


To solve cross-site scripting (XSS) vulnerability issues such as URL link injection, DOM-based XSS, URL wide-character and URL cross-site vulnerabilities, you can modify the iServer configuration file [SuperMap iServer installation directory] \webapps\iserver\WEB-INF\web.xml to enable protection against XSS attacks.

Configure to start protection against XSS attacks as follows:

<filter> 
      <filter-name>XssFilter</filter-name>
      <display-name>XssFilter</display-name>
      <filter-class>com.supermap.server.host.webapp.XssFilter</filter-class>
      <init-param>
            <param-name>processMode</param-name>
            <!-- Optional value:CLEAN or THROWERROR. CLEAN clears dangerous characters; THROWERROR throws exceptions -->
            <param-value>CLEAN</param-value>
      </init-param>
      <init-param>
            <param-name>antisamyName</param-name>
            <!-- Optional value:antisamy-myspace.xml, antisamy-ebay.xml, antisamy-tinymce.xml or antisamy-slashdot.xml -->
            <param-value>antisamy-ebay.xml</param-value>
      </init-param>
</filter>
<filter-mapping>
      <filter-name>XssFilter</filter-name>
      <url-pattern>/*</url-pattern>
</filter-mapping>

Note:

  1. When multiple web filters exist at the same time, the loading and implementation of each web filter has a strict order relationship. It is consistent with the definition order of each web filter in the web.xml file. In order to make XSSFilter work, you need to define FilterMappping for the Filter in web.xml.
  2. After the web.xml configuration is completed, restart the iServer (iPortal) to take effect.

Among them, the main configuration parameters are as follows: