Introduction:
Click-jacking, also known as a "UI redress attack", It is a malicious technique of tricking a web user into clicking on something different from what the user perceives they are clicking on.
We can mitigate the Click-Jacking with the help of X-Frame-Options in HTTP response header.
What is Click-Jacking?
Click-jacking, also known as a "UI redress attack", It is a malicious technique of tricking a web user into clicking on something different from what the user perceives they are clicking on.
What is an Impact?
An attacker uses multiple transparent or opaque layers to trick a user into clicking on a button or link on another page when they were intending to click on the top level page. Thus, the attacker is "hijacking" clicks meant for their page and routing them to other another page, most likely owned by another application, domain, or both.Using a similar technique, keystrokes can also be hijacked. With a carefully crafted combination of style sheets, I-frames, and text boxes, a user can be led to believe they are typing in the password to their email or bank account, but are instead typing into an invisible frame controlled by the attacker.How can we Mitigate?
We can mitigate the Click-Jacking with the help of X-Frame-Options in HTTP response header.
The
X-Frame-Options header can be
used to control whether a page can be placed in an IFRAME. Because the Frame
sniffing technique relies on being able to place the victim site in an IFRAME,
a web application can protect itself by sending an appropriate
X-Frame-Options header.
What is X-Frame-Options?
X-Frame-Options
is a mitigation
technique for click jacking attacks. It is an HTTP
response header sent by the server to indicate under what circumstances page
contents should be displayed in a frame context. A browser that understands the
header will not display the contents of a page if the header directive is
violated (for instance, if evil-example.com puts good-site.com in an I-frame
but good-site.com sends a header that says X-Frame-Options:
DENY
.
Thus, no click jacking can occur because no UI elements
can be displayed to a victim.
X-Frame-Options
is a mitigation
technique for click jacking attacks. It is an HTTP
response header sent by the server to indicate under what circumstances page
contents should be displayed in a frame context. A browser that understands the
header will not display the contents of a page if the header directive is
violated (for instance, if evil-example.com puts good-site.com in an I-frame
but good-site.com sends a header that says X-Frame-Options:
DENY
.
Thus, no click jacking can occur because no UI elements
can be displayed to a victim.What are the types of X-Frame-Options Header?
There are three possible values for the
X-Frame-Options headers:
• DENY, which prevents any domain from
framing the content.
• SAMEORIGIN, which only allows the
current site to frame the content.
• ALLOW-FROM Uri, which permits the specified
'Uri' to frame this page. As explained below. The ALLOW-FROM option is a
relatively recent addition (circa 2012) and may not be supported by all
browsers yet. BE CAREFUL ABOUT DEPENDING ON ALLOW-FROM. If you apply it and the
browser does not support it, then you will have NO click jacking defense in
place.
Configuring the X-Frame-Options in IIS
To configure IIS to add an X-Frame-Options header
to all responses for a given site, follow these steps:
- Open Internet Information Services (IIS) Manager.
- In the Connections pane on the left side, expand the Sites folder and select the site that you want to protect.
- Double-click the HTTP Response Headers icon in the feature list in the middle.
- In the Actions pane on the right side, click Add.
- In the dialog box that appears, type X-Frame-Options in the Name field and type SAMEORIGIN in the Value field.
- Click OK to save your changes.
Comments
Post a Comment