Preventing Cross Site Framing via X-Frame-Options

  • 15 February 2022
  • 0 replies
  • 333 views

Userlevel 5
Badge +20
 

Preventing Cross Frame Scripting (XFS) via X-Frame-Options

kbt141024

PRODUCT
K2 Five
K2 blackpearl 4.6.11
K2 smartforms 4.6.11 to 4.7
BASED ON
K2 smartforms 4.7
TAGS
Security
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.

 

Please note that the configurations in this article will allow Smart forms to frame themselves and will break integration with Sharepoint. 

It is recommended to use: Securing the K2 platform article

Issue

Cross-Frame Scripting (XFS) is an attack that combines malicious JavaScript with an iframe that loads a legitimate page in an effort to steal data from an unsuspecting user. When customers performed penetration tests or other similar security audits on their K2 Smartforms, they may receive reports explaining that Smartforms is vunerable to Cross-Frame Scripting.

 

This can be easily resolved by making sure Smartforms repond with the X-Frame-Options response header. The X-Frame-Options HTTP response header can be used to indicate whether a browser should be allowed to render a page in <frame>, <iframe> or <objects>. By default, K2 Smartforms is not set up with X-Frame-Options header configured.

Symptoms

  • Penetration tests, or other security audits will indicate that K2 Smartforms has failed the Cross-Frame Scripting test.
  • It is possible to display Smartforms on another web page by embedding an iframe to load Smartforms.

Troubleshooting Steps

Please note that setting X-Frame-Options will also prevent your SmartForms forms from loading properly within your SharePoint site.

  1. On the web server that is hosting your Smartforms, go to [Program Files]K2K2 Smartforms Runtime, open web.config, and add the X-Frame-Options, so that it looks similar to this in the Smartforms Runtime web.config:
     
    <system.webServer>
      ...
      <httpProtocol>
        <customHeaders>
          ...
          <add name="X-Frame-Options" value="SAMEORIGIN" />
        </customHeaders>
      </httpProtocol>
      ...
    </system.webServer>
  2. Perform IISRESET to apply the settings.
  3. You can also configure the same for your K2 Designer. Just edit web.config from [Program Files]K2K2 Smartforms Designer, and follow the same steps above.

Alternatively, you can also do it through the IIS Manager.


0 replies

Be the first to reply!

Reply