Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCross-origin redirection during initial page load messes up origin checks #23037
Comments
|
This happens even when clicking a cross-origin link to load the example. That's... very bad! |
|
I think the Just from reading the code, which should be taken with a grain of salt, here what I think happens:
So I think we're lucky the document raises The problem here is really that we're running a page from So if And even if you just load the redirect in an existing script-thread where I even think I think the fix for this could be something like:
|
https://www.joshmatthews.net/mlredir2.html has a 301 server redirect to https://threejs.org/examples/webgl_custom_attributes_points3.html. This yields a black screen and
SecurityError: The operation is insecure., while loading the threejs example directly yields a functioning webgl page. I suspect the underlying problem is that we create a script thread for the initial origin, then any redirected content is still loaded in that script thread and incorrect URLs are stored in various places that are later checked.