Unfortunately, the local files in IE7 can cross-origin with ajax.

Source: Internet
Author: User

Surging clouds

For example

File: // D:/soft/develop/env/sites/www.a.com/test.html

The code snippet is as follows:
......

Var xhr = new XMLHttp ();
Function postURLRet (url, data ){
If (xhr ){
Xhr. open ("POST", url, false );
Xhr. setRequestHeader (Content-Type, application/x-www-form-urlencoded );
Xhr. send (data );
Return xhr. responseText;
}
Return "";
}
</Script>
</Head>
<Body>
<Script>
Ret = postURLRet ("http://www.google.com ","");
Document. write (ret );
</Script>
</Body>

In IE 7, an insecure activex control is displayed by default, which requires confirmation.


After confirmation, you can cross-Origin


Firefox 3 does not have this problem


However

Things in the world often come from this.

The ietab extension of firefox does not have any security prompt and confirmation, and cross-origin is directly used.



I don't know if other third-party browsers with IE as the core will also have this problem.


In general, IE should not enable cross-origin for local files. Even if you need to confirm it, this is very inappropriate. It is equal to an additional path that can break the security model, although a card is set up, who knows which day it will not be bypassed.

If cross-origin of local files is combined with other vulnerabilities, such as downloading arbitrary files (with no execution and predictable paths), the power is huge.

The sum of the two vulnerabilities may turn into a very good bug.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.