9 ms·
That's actually a huge annoyance of mine. There's no stable, cross-platform web API to get raw sockets, and I'm not sure why.
by roblabla 9y ago
That's actually a huge annoyance of mine. There's no stable, cross-platform web API to get raw sockets, and I'm not sure why.
- slrz 9y agoHow would that interact with the Same-Origin Policy?
- kevincox 9y agoSince you wouldn't have access to cookies I don't think it would be the end of the world. However you would have access to the users LAN which would likely make many local devices' vulnerabilities exploitable. All in all it is probably a bad idea with the current state of IoT, home routers, printers...
- Spivak 9y agoGiving a web page access to any part of the user's environment not explicitly given to is malicious data exfiltration waiting to happen.
- QasimK 9y agoImagine if every webpage (JavaScript) could open sockets to any location and port - sounds like a significant security issue.
- misterbowfinger 9y agoI just don't get how that's different than anything that's not a webapp
- slrz 9y agoYou probably don't run arbitrary untrusted applications on your computer but you execute arbitrary untrusted Javascript all day when visiting web sites. To make this seemingly crazy thing work at all, some restrictions have to be imposed on that untrusted JS code.
- banachtarski 9y agoThey essentially can via the WebRTC api, albeit in a more cumbersome way. There's nothing inherently insecure about it and the onus rests on the serving party and the browser itself to ensure no foul play is happening.
- lmz 9y agoDoesn't WebRTC have a handshake protocol to ensure that the other end expects the WebRTC media stream?
- banachtarski 9y agoIf you allow a browser to open sockets to random places, it's the exact same principle! The onus is on the listener to ensure that the people communicating respect the agreed upon protocol.
- tokenizerrr 9y agoThen every browser could be used to send spam. It would be horrible. Imagine that every person who visits a compromised page immediately started sending spam emails over smtp. Or spam irc messages.
- roblabla 9y agoFlash could do that, and yet I've never heard of it as a problem.
- jhgg 9y agoGenerally is not a problem, as Flash needs to check a file called "crossdomain.xml" that is served from the destination server, which specifies how Flash can communicate with it. http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html http://www.adobe.com/devnet/articles/crossdomain_policy_file...
- Paul-ish 9y ago
- Franciscouzo 9y agoThe obvious solution would be to ask the user for permission before opening the socket.
- deleted 9y ago[deleted]
- Paul-ish 9y agoThis is always the proposed answer whenever someone wants to introduce X potentially insecure API. It is lazy IMO. It requires the potentially uninformed user to make a critical decision. Plus, if we introduced every insecure-but-we-prompt API proposed, the user would be inundated with prompts and it would reduce their productivity.
- MertsA 9y agoForget impacting their productivity, we've already seen what happens when you defer these questions to the user. They always hit yes or okay. It's like it's not even there, people would view mindlessly accepting prompts like that's just how you're meant to use a computer.
- ascorbic 9y agoMore important than reducing productivity is the problem that prompt-overload conditions people to just blindly click accept.
- dom96 9y agoAnd yet Flash allows this and it hasn't been a problem for years?
- kbuck 9y agoFlash requires you to install a socket policy daemon[1] that typically listens on port 843 (which is why the MITM test requires that port 843 be open). When you request a raw socket, Flash first connects to port 843 and requests the policy file, which will tell it whether it's allowed to use raw sockets with that server. I've set one of these up before, and I'm not really a fan. [1]: http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html http://www.adobe.com/devnet/flashplayer/articles/socket_poli...
- Franciscouzo 9y agoThere's this [0] standard that nobody implements, AFAIK the security risks could be mitigated by asking for confirmation from the user. [0] https://www.w3.org/TR/tcp-udp-sockets/ https://www.w3.org/TR/tcp-udp-sockets/
- Paul-ish 9y agoI'm not sure users would understand what they are being asked. Plus, whenever someone wants to do something dangerous in the browser, they say "Oh, we will ask the user". If everyone got their way, users would be inundated with dialogs.