News for hackers. Stuff that matters.
Re:Show HN: Include this JS library to enable cross-origin r... by untog on Monday November 25, 2013 @09:58AM (#6794305)
Overwhelmingly terrible idea. Routing your web site traffic through an entirely unknown third party server. Overwrite the global XMLHttpRequest object.

Please tell me this is a joke to show off terrible security practise?

Re:Show HN: Include this JS library to enable cross-origin r... by odedgolan on Monday November 25, 2013 @10:15AM (#6794411)
Regrading overwriting XMLHttpRequest, if it works - it works, and if it breaks it can be improved, this is why it is open source. It does not reroute your site traffic just your cross-origin site traffic, which practically does not exist without this library. Yes it can be used to do bad thing but also opens up the opportunity for mashups, external content integration, api calls and more.
Re:Show HN: Include this JS library to enable cross-origin r... by Joe8Bit on Monday November 25, 2013 @09:53AM (#6794270)
Routing all your x-domain requests through an unknown third part via vanilla HTTP? What could possibly go wrong?
Re:Show HN: Include this JS library to enable cross-origin r... by odedgolan on Monday November 25, 2013 @10:07AM (#6794361)
It's just your cross-origin traffic, which is not possible without this library, everything else will behave exactly the same.
Re:Show HN: Include this JS library to enable cross-origin r... by Joe8Bit on Monday November 25, 2013 @12:27PM (#6795411)
And whoever is running this proxy will _promise_ not to log any sensitive information (API keys not the least) or otherwise use/modify the response for their own ends?

Not to mention that the API endpoint is HTTP only, meaning everything is broadcast in the clear.

Also, cross origin requests are perfectly possible without this library, it's precisely why we use JSONP and CORS.

When it comes to security, this library is a collection of anti-patterns. As well as the JS anti-pattern of not overwriting native objects, such as XMLHttpRequest in this context.

Re:Show HN: Include this JS library to enable cross-origin r... by drderidder on Monday November 25, 2013 @10:07AM (#6794355)
Please don't use this. JSONP and CORS are the accepted methods for cross origin requests.
Re:Show HN: Include this JS library to enable cross-origin r... by odedgolan on Monday November 25, 2013 @10:09AM (#6794380)
You can only use JSOP and CROS with sites you have control over or are designed to behave and support external requests. It makes it very very limited!
Re:Show HN: Include this JS library to enable cross-origin r... by mkohlmyr on Monday November 25, 2013 @10:19AM (#6794450)
"You can only use JSOP and CROS with sites you have control over or are designed to behave and support external requests."

That's kind of the point.

Re:Show HN: Include this JS library to enable cross-origin r... by odedgolan on Monday November 25, 2013 @10:32AM (#6794544)
It limits the thing you can do. This library allows you to easily get and display content from any external source.
Re:Show HN: Include this JS library to enable cross-origin r... by drderidder on Tuesday November 26, 2013 @12:21AM (#6799316)
Those limits are a security measure to protect against XSS and CSRF. Intentionally weakening your site security isn't a good idea for most people. Your mash up site evidently uses this to get around same origin policy without the cooperation of targeted sites. It would be interesting to know how you plan to mitigate those risks.
Re:Show HN: Include this JS library to enable cross-origin r... by buzzedword on Monday November 25, 2013 @09:54AM (#6794281)
How is this remotely trending? Yes, HN, let's vote a MITM attack to the frontpage. This is a terrible idea.
Re:Show HN: Include this JS library to enable cross-origin r... by odedgolan on Monday November 25, 2013 @10:03AM (#6794334)
Yes it allows you to do back stuff. But it also allows great things as mashups, retrieving external content easily etc.
Re:Show HN: Include this JS library to enable cross-origin r... by buzzedword on Monday November 25, 2013 @10:21AM (#6794460)
Tell you what. Since I'm not a big fan of the lynchmob, here's the only positive critique I'll give you: proxying isn't an altogether terrible idea. It's not my first go to, but it does have it's place. HOWEVER. Allowing a third party to manage it, is. If you genuinely want to create some buzz and interest, source the serverside of this, and write some docs up how to deploy it to AWS, Heroku, etc. Bundle the JS with that. That'll be infinitely more useful than this service.

You're asking that I trust you will not modify the response in any way shape or form. The very nature of software dev mandates that I do not trust data that is not my own; and even then, verify it. You're asking quite a lot here. This is by all points and purposes, a man-in-the-middle attack vector.

Re:Show HN: Include this JS library to enable cross-origin r... by odedgolan on Monday November 25, 2013 @10:30AM (#6794532)
OK, it is a trust issue. However you can use this library and change the proxy url to your own server and still get the benefit of the fact that you don't need to rewrite external requests and just use jQuery.
Re:Show HN: Include this JS library to enable cross-origin r... by buzzedword on Monday November 25, 2013 @11:10AM (#6794855)
At that point, if I wrote my own proxy server, I'd drop the JS altogether and just request a proxy link. I know what's cross-origin in my code, so if I wanted to mitigate it with a proxy, I don't need the additional library. Still say your best bet is losing the JS and opening up the server. I mean, what's going to be better here, telling everyone "it's a trust issue", or passing on a relatively simple self-hosted proxy server made specifically for CORS-faking? Else, my big trust question is "why exactly do you WANT me to forward my traffic through your black box server?"
Re:Show HN: Include this JS library to enable cross-origin r... by Scriptor on Monday November 25, 2013 @09:57AM (#6794296)
This is just a proxy. If developers wanted to go this route they would set up the proxy on their own server instead of routing it through a 3rd party.
Re:Show HN: Include this JS library to enable cross-origin r... by odedgolan on Monday November 25, 2013 @10:00AM (#6794316)
It's possible, we just make it easier. This library also make it seamless (you can still use jQuery.ajax). They can use this library and just change the proxy url.
Re:Show HN: Include this JS library to enable cross-origin r... by Rami114 on Monday November 25, 2013 @10:25AM (#6794488)
If you need to ask why it is bad to route traffic through an untrusted third party over HTTP, for the love of god stop building web applications. This is not the right tool for the problem it's trying to solve.
Re:Show HN: Include this JS library to enable cross-origin r... by odedgolan on Monday November 25, 2013 @10:37AM (#6794587)
"untrusted" is the issue here, and trust is built over time. In the meanwhile you can use the library and implement the server side.
Re:Show HN: Include this JS library to enable cross-origin r... by silasb on Monday November 25, 2013 @09:53AM (#6794268)
I would let the users know that requests get routed through a server you control.
Re:Show HN: Include this JS library to enable cross-origin r... by odedgolan on Monday November 25, 2013 @09:58AM (#6794301)
It only goes through our servers if it's cross-origin. Normal http same-origin requests are left intact (and you can see it in the code). It's stated on the README but perhaps it should be more apparent.
Re:Show HN: Include this JS library to enable cross-origin r... by jscheel on Monday November 25, 2013 @10:42AM (#6794616)
I'll probably never use this library for anything, but I've submitted a pull request that takes out their 3rd party proxy and merely suggests it in the error that is thrown if you don't define your own. https://github.com/TOMODOcom/TOMODOkorz/pull/1
Re:Show HN: Include this JS library to enable cross-origin r... by Couto on Monday November 25, 2013 @09:54AM (#6794283)
Seems a cool idea to use with mockups and prototypes, but an awful idea to use in a serious product.
Re:Show HN: Include this JS library to enable cross-origin r... by odedgolan on Monday November 25, 2013 @10:04AM (#6794347)
Why? remember your product will function exactly the same. It just makes more thing possible.
Re:Show HN: Include this JS library to enable cross-origin r... by gpvos on Monday November 25, 2013 @10:10AM (#6794383)
No, it will not function exactly the same, because it sends stuff through your server. That is a very important difference.

Leaving my front door open when I'm on holiday also makes more things possible. That does not mean I will like those things.

Re:Show HN: Include this JS library to enable cross-origin r... by orenbarzilai on Monday November 25, 2013 @10:18AM (#6794430)
If you are working on super sensitive website for the NSA, I totally agree. YOU SHOULDN'T USE IT.

But if you have a blog and you would like to constantly display some specific content from a different webpage via ajax it seems like the easiest & most simple solution.

Re:Show HN: Include this JS library to enable cross-origin r... by Couto on Monday November 25, 2013 @10:25AM (#6794484)
Don't take me wrong… I would use your service in any proof-of-concept/mockup/prototype… It really helps a lot in those use cases, since is one less thing for me to worry about.

I just don't trust it enough to use in production.

Re:Show HN: Include this JS library to enable cross-origin r... by odedgolan on Monday November 25, 2013 @10:34AM (#6794565)
There is a level of trust needed. However, you can use this library, change the proxy url and implement the server side yourself.
Re:Show HN: Include this JS library to enable cross-origin r... by Couto on Monday November 25, 2013 @10:23AM (#6794471)
I don't doubt that your service works with the best intentions, but why should I open a security hole in my application, when I can easily avoid it by writing my own proxy and keep it private?

What happens to my application, if your service goes through a DDoS? What happens to my application, if you suddenly decide to close your service?

I'm pretty sure you can use these arguments about other services, but this service exactly, is not worth the risk.

Re:Show HN: Include this JS library to enable cross-origin r... by captn3m0 on Monday November 25, 2013 @10:59AM (#6794749)
If you trust Yahoo!, you can try proxying requests via Yahoo Pipes for Cross-Origin support. Not that I recommend it, though.

[1]: https://gist.github.com/psychemedia/316660