Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Same-origin policy considered harmful.

Name: Cudder !cXCudderUE 2015-05-03 13:44

I don't usually touch web apps, but when I do, it's either because a client wanted it or it seemed an extremely fitting use-case...

Suppose you have a set of sites, which are not under your control, that you want to aggregate data from and process, then present on another webpage. Furthermore, suppose that these sites contain data that you don't want to send to a remote server, either because they require credentials you don't trust a 3rd-party with or contain sensitive, personalised data.

It sounds like the perfect job for a "web app" - basically, just a single page that uses AJAX to fetch the data from the remote sites and then JS to process it and show the results would be ideal. It could be done with native code, but why not take advantage of what the browser offers for interacting with websites?

Except... it doesn't work. AJAX requests can't go across different sites! There is a way to do it which requires both ends cooperating (which can't happen in this case), or asking another server to fetch the data (again, not allowed). The reason is again "security"; but consider that if cross-origin requests were allowed, web apps might actually be 1000x more useful and closer to what native code can do than the castrated "render a UI client-side" crap they are today.

Many of you are probably screaming "but muh security!! muh monies in muh bank account!!" at this point - and you would be right, allowing any site to access data from any other site might not be the best idea - but so is allowing any site to run JS in the first place! If per-site JS settings had become the norm we might've gotten the fine-grained permissions ("allow site X to access site Y?") that gives the user control and lets these extremely powerful web apps thrive, but thanks to the retarded "every site should be allowed to run JS and browsers should have it defaulted to on" notion we got this watered-down crap that needs a ton of jumping-through-hoops and can't even do anything close to what "native apps" can do despite the "appers" thinking it can. It's amusing to see the sites that do manage to do such aggregation need to proxy the requests through a server and then give it back to you, which is the stupidest thing for actual security.

What a load of bovine fecal matter.

Name: /del/ 2015-05-03 15:19

/del/

Name: Anonymous 2015-05-03 16:01

Greasemonkey/Tampermonkey userscripts bypass SOP
http://wiki.greasespot.net/GM_xmlhttpRequest

Name: Cudder !cXCudderUE 2015-05-04 6:25

>>3
Duh. That's not the goal though.

Also noticed that the prototype I wrote doesn't work in every browser I tried except... IE6, where same-origin doesn't even matter and I can actually do something useful with AJAX. LOL WUT.

Name: Anonymous 2015-05-04 6:35

>>4
Useful until your clients connections get spoofed and have their tokens/credentials stolen.

Name: Cudder !cXCudderUE 2015-05-04 11:34

>>5
That's why you don't enable JS on every fucking site by default.

Name: Anonymous 2015-05-04 23:00

>>6
C-C-Cudder-san! You may be missing something in there...

Name: Anonymous 2015-05-04 23:04

I think that JS should only be allowed to query Google servers. Then Google could proxy the request if it is deemed safe.

Name: Anonymous 2015-05-04 23:23

>>8
Ah, yes. Let's trust Google!

Name: senza nome 2015-05-05 0:05

Io non ho mai nella moral sentito
ch'uno ch'ami la moglie odi il marito.

Name: Anonymous 2015-05-05 5:23

Trust these dubs.

Name: Anonymous 2015-05-05 13:55

>>11
Sorry, I'll need to examine your cert first.

Name: Anonymous 2015-05-05 14:02

examine this
*grabs dick*

Name: *grabs dick* fan 2015-05-06 2:14

*grabs dick* is my favorite meme.
*grabs dick*

Name: Anonymous 2015-05-06 3:45

>>14
Here we go...

*grabs duck*

Name: Anonymous 2015-05-06 6:35

>>15
let me go you piece of shit i'll call peta on you

Name: Anonymous 2015-05-06 7:32

>>16
QUACK, MOTHERFUCKER!

Don't change these.
Name: Email:
Entire Thread Thread List