News for hackers. Stuff that matters.
Re:Why Is This Website Port Scanning Me? by habyte on Wednesday May 20, 2020 @10:34AM (#23247287)
I'm sorry, what's the alternative for (soft-)real-time applications on frontend if not WebSocket? You probably do want to use it.
Re:Why Is This Website Port Scanning Me? by 90minuteAPI on Wednesday May 20, 2020 @11:51AM (#23248325)
Server Sent Events and HTTP? With a modern setup it’s going to be sharing an HTTP/2 pipe anyway. Even handles disconnections gracefully/transparently if you’re clever about it.

Can anyone expand on why this technique isn’t more common? I’m so sick of seeing folks reinvent HTTP (poorly) on top of WebSockets. I get if extreme low latency is (allegedly) a requirement.

Re:Why Is This Website Port Scanning Me? by verandaguy on Wednesday May 20, 2020 @12:30PM (#23248826)
>Can anyone expand on why this technique isn’t more common?

Hard answer: WS has been around for longer, and it's had more "marketing" for lack of a better word -- more people know about it and know how to use it. Retooling existing WS-using code to use HTTP/2 pipes would be a considerable effort with little to no perceived benefit to most users and teams.

Speculative answer: most web developers live closer to the application and presentation layers, and there's resistance to learning technologies that involve HTTP connection management e.g. in nginx (not to say that there are none of these, there are just fewer of us). WS was at the right place at the right time with a good high-level interface available to the client, and gained traction because of this.

Re:Why Is This Website Port Scanning Me? by iokanuon on Wednesday May 20, 2020 @12:05PM (#23248494)
From what I remember about SSE, no Microsoft browser supported them. It seems like they've finally added support to Edge this year though.
Re:Why Is This Website Port Scanning Me? by pennaMan on Wednesday May 20, 2020 @12:09PM (#23248549)
Re:Why Is This Website Port Scanning Me? by anderspitman on Wednesday May 20, 2020 @02:02PM (#23249862)
If you're using HTTP/2 this problem goes away.
Re:Why Is This Website Port Scanning Me? by nemothekid on Wednesday May 20, 2020 @08:54PM (#23253767)
>Can anyone expand on why this technique isn’t more common?

Because WebSockets is 10 years old and HTTP/2 is 5 years old, and that's not including support in major frameworks for SSE.

Re:Why Is This Website Port Scanning Me? by michaelt on Wednesday May 20, 2020 @12:02PM (#23248466)
Web sockets, but redesigned to only connect to the host shown in the address bar, on port 443.
Re:Why Is This Website Port Scanning Me? by derefr on Wednesday May 20, 2020 @12:13PM (#23248591)
Doesn’t work if www.example.com is just an S3 bucket, with the actual website at api.example.com.
Re:Why Is This Website Port Scanning Me? by michaelt on Wednesday May 20, 2020 @12:45PM (#23248992)
That sounds like the developer's problem, not the browser's problem.

I mean, I could half-ass my work a lot more often if they'd get rid of these burdensome restrictions on cross-origin requests. But they ain't going to.

Re:Why Is This Website Port Scanning Me? by derefr on Wednesday May 20, 2020 @12:53PM (#23249076)
Domains are never going to be just one origin. If we could force developers (or, more precisely, ops teams) to do this, then CORS would never have needed to exist in the first place, because there would be no need to allow any crossing of origins in the first place.

But, at every point in the web’s evolution (including today), there was always been something that needed to live on a different host or port for some reason or another—usually because it’s too leading-edge for load-balancers to understand how to route it correctly.

TCP load balancers that can handle long-lived flows with connection stickiness et al, are a very modern invention in the web’s history; and even they still stumble when it comes to e.g. WebRTC’s UDP packets, or QUIC.

Re:Why Is This Website Port Scanning Me? by bjt2n3904 on Wednesday May 20, 2020 @01:39PM (#23249600)
This man right here understands things.
Re:Why Is This Website Port Scanning Me? by phkahler on Wednesday May 20, 2020 @11:02AM (#23247668)
Native applications?

Not everything needs to run in a browser.

Re:Why Is This Website Port Scanning Me? by Spivak on Wednesday May 20, 2020 @11:19AM (#23247917)
But that’s even worse! Native apps have even less (i.e. zero most of the time) sandboxing than the browser.

This wouldn’t be a meaningful security improvement for anyone.

Re:Why Is This Website Port Scanning Me? by danieldk on Wednesday May 20, 2020 @11:31AM (#23248083)
You use a much smaller set of applications than web sites. Moreover, you usually vet your applications and do not run random stuff. Application developers build up trust over time.

Even if I want to use the web as hypertext + some Javascript for interactivity, every stupid web site can pull these shenanigans.

Re:Why Is This Website Port Scanning Me? by danShumway on Wednesday May 20, 2020 @12:10PM (#23248558)
You use a much smaller set of applications than websites because websites exist.

You're imagining a world where the most popular dev environment goes away, and service providers decide to use HTML forms instead of forcing me to download an app every time I want to order a pizza. That world does not exist. The apps aren't going to go away, and your security model can't be, "people just won't install untrustworthy apps."

And put things in perspective here -- we're talking about a security vulnerability that allows port scanning primarily for fingerprinting purposes. A native app can not only port scan, it can literally just make POST requests to those open ports across separate domains. The security risks we're talking about are not even remotely equivocal.

Don't get me wrong, stuff like port-scanning should be fixed in web browsers. But even with these vulnerabilities, the web is still unquestionably the safest consumer-accessible application platform that we have today. Moving applications off of the web and back onto native platforms would be setting security back half a decade.

When someone comes to me and asks how they make their phone more secure and more private, the number one piece of advice I give them, every single time, is "avoid native apps and use websites instead. Don't install Facebook, use the website. Don't install random clicker games, browse them online instead."

The web has been a major asset in my quest to get friends and family not to install a bunch of random malware on their devices. Doubly so when you throw kids and younger users into the equation. I am eternally grateful that the web is advanced enough that people can join a Zoom meeting without installing Zoom on their computer.

Re:Why Is This Website Port Scanning Me? by rpastuszak on Wednesday May 20, 2020 @11:47AM (#23248273)
A flashlight app asking for your contact list disagrees (don't forget about the FB SDK sitting quietly in the corner)
Re:Why Is This Website Port Scanning Me? by gbear605 on Wednesday May 20, 2020 @12:51PM (#23249060)
Maybe that’s true for you, but if the modern web apps didn’t exist, most average people would be downloading dozens or hundreds of miscellaneous apps. “Oh, I want to order a pizza on my computer, time to download the Domino’s app.” And then now you have Domino’s ads running as daemons on your system.
Re:Why Is This Website Port Scanning Me? by jackewiehose on Wednesday May 20, 2020 @10:41AM (#23247384)
The alternative is to ask the user on a site basis.
Re:Why Is This Website Port Scanning Me? by bjt2n3904 on Wednesday May 20, 2020 @10:49AM (#23247492)
That would be amazing, but it would never happen. Mom and Pop would always click "no" out of fear of the unknown, and my awesome feature wouldn't get used! It has to be enabled by default, they don't know what they're missing!
Re:Why Is This Website Port Scanning Me? by gsnedders on Wednesday May 20, 2020 @12:46PM (#23249007)
That's literally the opposite of the concern with permission prompts: all the evidence from years of SSL/TLS certificate errors is that users will blindly grant permission.
Re:Why Is This Website Port Scanning Me? by bjt2n3904 on Wednesday May 20, 2020 @01:41PM (#23249617)
This is true -- and it may also be the same for miscellaneous permissions. But that doesn't mean it won't be used as an excuse by the feature developers.

Honestly though, this is just me being bitter at web developers.

Re:Why Is This Website Port Scanning Me? by derefr on Wednesday May 20, 2020 @12:15PM (#23248627)
That’s already how the browser microphone/camera API and notification API work, though. At this point, it’s the expectation/default for new APIs to act this way. The browser makers would just have to be convinced to align the behaviour of these slightly-older APIs to the best-practice UX paradigm for new APIs.
Re:Why Is This Website Port Scanning Me? by kchr on Wednesday May 20, 2020 @12:07PM (#23248523)
Surely everybody needs My Feature(TM)!
Re:Why Is This Website Port Scanning Me? by usr1106 on Wednesday May 20, 2020 @10:49PM (#23254371)
Right. Firefox is open source. Why is nobody adding prompts for Web Sockets, WebGL, Web Assembly and all the new stuff that a security / privacy concerned user has at least mixed feelings about. Prompts are not a good solution for a wider audience, but at least they satisfy the curiosity of power users and offer the possibility to leave the site if you get the feeling it's too dodgy.
Re:Why Is This Website Port Scanning Me? by kalium-xyz on Wednesday May 20, 2020 @10:36AM (#23247305)
Webrtc, plain requests, and side channels involving streams
Re:Why Is This Website Port Scanning Me? by SmallPeePeeMan on Wednesday May 20, 2020 @10:58AM (#23247609)
Native applications.
Re:Why Is This Website Port Scanning Me? by LunaSea on Wednesday May 20, 2020 @11:10AM (#23247780)
Native applications have orders of magnitude more access to your system than a website has.
Re:Why Is This Website Port Scanning Me? by rpastuszak on Wednesday May 20, 2020 @11:48AM (#23248285)
This isn't a loaded question, but how come people (especially the people here) don't know that?
Re:Why Is This Website Port Scanning Me? by SmallPeePeeMan on Wednesday May 20, 2020 @04:09PM (#23251183)
the real question is: Why do people write websites to behave more and more like native apps? In order to prevent a client-side install?

For applications that want special access to my machine, there SHOULD be a barrier to entry or inconvenience like a client-side installation.