- using any CORS configuration?
Yes, victor.eve.tld/ has to allow the IP address of victor.alt inIf Eve sets her Access-Control-Allow-OriginCORS header. This way the page at victor.alt can send a regular XHR to victor.eve.tld/ and Access-Control-Allow-Origin "victor.alt" Victor can verify the contents of the HTML it retrieves, and verify all referenced scripts tooas well.
- while allowing read-only access?
- while limiting the the parent window's access to the content of the iFrame?
These do notNeither of these exist, an iframeiFrame cannot read the contents of another iframeiFrame unless they are on thethe same domain.
You can also do it without the CORS on victor.eve.tldHowever, it is possible when victor.alt hasyou could push any user information you want to keep private from Victor into a proxy service that can successfully load the webpage at victor.eve.altsandboxed iFrame and using window.postMessage to communicate between frames. You Victor can try it out yourself live by pasting the following code intomonitor the console at http://hileco.com/, which executesactivity between the code in a child iframe at sandbox.hilecotwo to ensure that no information is being leaked.com ( Paste it, reload sandbox, run )
require(["module/http"], function (httpModule) { // httpModule is a proxy at sandbox.hileco.com aka victor.alt httpModule.get("http://hileco.com", function(xhr){ // hileco.com is victor.eve.alt if(xhr.responseText.length == 7740){ // note that this will change in the future in the case of hileco.com :-) console.log("7740? Undoubtedly this must be the untampered hileco.com"); } else{ console.log("Run!"); parent.location = "about:blank;"; } }); });