Try   HackMD

弱點掃描被掃出 Clickjacking - X-Frame-Options header is not set ,用 IIS 的解決方法

Clickjacking 點閱綁架是什麼?

clickjacking 的原理是利用覆蓋隱藏畫面,讓使用者在看不出來的狀況下點擊到其他內容

2008的時候,Adobe Flash Player有這樣子的漏洞,一位Flash開發人員Guy Aharonovsky在部落格上展示了概念性攻擊程式,他設計了一個網路遊戲,當使用者點擊遊戲中的按鍵後,駭客就可能存取使用者的視訊攝影機及麥克風。

https://www.youtube.com/watch?v=gxyLbpldmuU


威脅 Threat

X-Frame-Options header is not set, and that may lead to a possible framing of the page. An attack can trick the user into clicking on the link by framing the
original page and showing a layer on top of it with dummy buttons.

衝擊 Impact

Attacks like Clickjacking and Cross-Site Request Forgery (CSRF) could be performed.

解決方案 Solution

Set the X-Frame-Options: This header works with modern browsers and can be used to prevent framing of the page. Note that is must be an HTTP header, the
setting is ignored if it is created as an "http-equiv" meta element within the page.

解決說明

header 增加 x-frame 同源政策,可以避免外部網站呼叫, iis 的話在 web.config設定就好

請加入以下指令到網站的 Web.config 檔:

    <system.webServer>
      ...
     
      <httpProtocol>
        <customHeaders>
          <add name="X-Frame-Options" value="SAMEORIGIN" />
        </customHeaders>
      </httpProtocol>
     
      ...
    </system.webServer>

參考來源

tags: 資安