This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice This article is not considered official documentation for K2 software and is provided “as is” with no warranties.
If you are performing penetration test on your SmartForms, you may encounter a warning about how the HTTP response headers returned contains information about the web server which could be useful to attackers.
Penetration test report highlights the following HTTP headers that pose security issues:
Please note that these headers are not added by K2, but inserted automatically by IIS and .NET Framework.
To remove the X-AspNet-Version, X-AspNetMvc-Version, and Server headers:
- If you are using Forms STS for authentication, go to [Program Files]\K2 blackpearl\WebServices\Identity\Sts\Forms.
- Alternatively, if you are using Windows STS, go to [Program Files]\K2 blackpearl\WebServices\Identity\Sts\Windows.
- Open Global.asax with a text editor
- Append the following line and save:
protected void Application_PreSendRequestHeaders(object sender, EventArgs e)
To remove the X-Powered-By header:
- Open IIS Manager
- Expand Sites > [Your K2 Site] > Identity > Sts
- Select Forms if you are using Forms STS for authentication. Otherwise, select Windows if you are using Windows STS.
- Select HTTP Response Headers
- Remove X-Powered-By:
Once you are done, perform a IISRESET, clear browser cache, and check again if the headers appear.