Cross-Frame Scripting (XFS)

Summary

Cross-Frame Scripting (XFS) is an attack that combines malicious JavaScript code with an iframe which loads a legitimate page in an effort to steal data from unsuspecting users; this attack is usually successful only when combined with social engineering.


Explanation

An example could be when an attacker convinces a user to browse a web page where the attacker has control, the attacker's page loads malicious JavaScript code on a legitimate page within an iframe, the malicious code captures the keys pressed by the attacker. user in order to steal passwords or credit card numbers, etc.

Execution

The standard browser security model allows JavaScript from one web page to access the content of other pages that have been loaded in different browser windows or frames, as long as those other pages have been loaded from the server or domain of the same origin. It does not allow access to pages that have been loaded from different servers or domains. However, there are specific flaws in this security model in specific browsers, allowing an attacker to access some data on pages loaded from different servers or domains. The most well-known bug affects IE (Internet Explorer), which filters keyboard events in HTML frame sets. This bug could allow, for example, an attacker to steal a user's login credentials from the browser while attempting to enter them into the login form of a third-party web page.


Recommendation

Add header:

x-frame-options:SAMEORIGIN

This header allows modern browsers not to run these types of attacks.

Online Checker

https://gf.dev/x-frame-options-test






Comments

Popular posts from this blog

Insecure Transport - Weak SSL Cipher

List of HTTP status codes

Insecure Transport: Channel Mixing