Friday, August 19, 2011

About Browser Content Sniffing

Before you can understand content sniffing you need to know the basic idea behind it that allows such behavior by hackers. I'll explain what content type is and than show you how a computer hacker looks at it while content sniffing.

Every time your web browser requests a page, the web server sends “headers” before it sends the actual page markup. These invisible headers are important, because they tell your browser how to interpret the page markup that follows. The most important header is called Content-Type, and it looks like this:

Content-Type: text/html

“text/html” is called the “content type” or “MIME type” of the page. This header is the only thing that determines what a particular resource truly is, and therefore how it should be rendered. Images have their own MIME types (image/jpeg for JPEG images, image/png for PNG images, and so on). JavaScript files have their own MIME type. CSS stylesheets have their own MIME type. Everything has its own MIME type.

Content Sniffing

When a client initiate an HTTP request to a server it gets response containing the data in return. Each browser has its own Content Sniffing Component that receive the response, try to identify the content type of the response (if it isn't specify) and than sends it to the browser itself.

This component opens a huge hole for hackers to "Trick" the browser's content sniffing component and "Let it guess" that the response contains regular data.

Why is that important?

when the browser receive the data sent from the server from the content sniffing component it acts and render it according to its content type. For example it present it if it is an image, it plays it if it has an audio type and so on. If the hacker managed to trick the browser that it can run its content than the hacker can download harmful data to your computer and simply let the browser run it, thinking its a regular file.

So, what can you do?

Be careful not to open content you don't know or trust while surfing (specially when you receive emails from people you don't know). Most of the Antivirus software today warns you before they navigate to "suspicious" pages so be sure you have an Antivirus software on your computer.

If you have "all your life" inside your computer, have a backup software that covers the worst case scenario and protect you from the day of disaster.

Be careful,

Enjoy.

No comments:

Post a Comment