Lets learn "What is XFO (X-Frame Options)?"


In this tutorial , We'll be discussing on XFO (X-Frame Options) . Actually XFO is not a vulnerability , it is just an optional attributed in response header of any server response . But missing of XFO in response header might create a loophole for hackers to attack on the websites .


Lets first know about the important term Clickjacking .

Clickjacking (User Interface redress attack, UI redress attack, UI redressing) is a malicious technique of tricking a Web user into clicking on something different from what the user perceives they are clicking on, thus potentially revealing confidential information or taking control of their computer while clicking on seemingly innocuous web pages.

Let's understand this ...
If any user want to load another website on his on web page (a part of it) , one of the possible solutions is using i-frame tag in html . Click on any button/link from the website loaded in the iframe
can also send cookies(corrosponding to the loaded website) with the request . Now let us take an example , suppose you have logged in to the bank website ,so its session cookies are stored in web browser . Suppose there is a button on bank website used to transfer money to an account from current logged in account and the link on buttons is :
https://www.onlinebank.com/send?to=acc_no_where_to_send&amount=amt_to_send
Now if a hacker make a web page , load the bank website in an i-frame such that amount transfer button is in the window of i-frame . The hacker applied a canvas just above the transfer button , and an canvas says "CLICK TO SEE THE MAGIC" . When any user clicks on the canvas , it actually clicking on the button below the canvas which trigger the amount transfer request without letting know to user .

This is known as Clickjacking .

So the main problem caused if XFO is not there in the response header, is Clickjacking .
If there is X-Frame options in the response header , the web browser prevent to load the website in an i-frame on any web site and thus preventing clickjacking .



In the above picture X-Frame-Options : SAMEORIGIN is there in response. It means that iframe will load website only the webpage where iframe is there is of same origin (having the same domain) . https://www.abc.com can load in iframe contained in https://www.sellers.abc.com .

Remediation
Configure your web server to include an X-Frame-Options header. Consult Web references for more information about the possible values for this header.

Hope now you understand what XFO is , what problems can be caused if there is missing XFO , and how to solve the problems .

For any problems or queries , please comment below .

Stay tuned for upcoming tutorials .
Till Then
HAPPY HACKING !!

Comments

Popular posts from this blog

Lets learn "About kube proxy in iptables mode"

Lets learn "System design for paste bin (or any text sharing website)"

Lets learn "What is CDN?"