News for hackers. Stuff that matters.
Re:Why Is This Website Port Scanning Me? by bjt2n3904 on Wednesday May 20, 2020 @10:19AM (#23247068)
Every time I hear about some shiny new feature being added to a browser, I think...

1) Will I ever actually use this

2) How is this gonna screw me over

WebSockets, WebBluetooth, WebAssembly, Web-You-Can-Access-my-Accelerometer-and-Battery, haven't ever wanted to use those. Ever. For anything. For any reason. (Edit 3: Oh yeah, I forgot! WebRTC!)

Edit: Fantastic. You can't disable it in Firefox. So what, does Firefox need a freaking iptables implementation now? [1]

1 - https://bugzilla.mozilla.org/show_bug.cgi?id=1091016

"The only theoretical reason for the WebSocket pref these days is the possibility to disable it easily in case there is a security issue found in the protocol itself or so."

The protocol itself is the security issue. ALL OF IT.

Edit 2: So I don't have the time to investigate every new fad when it comes out. I originally thought WebSockets were raw sockets, but they aren't. Firefox blocks access to port 22 -- I was hoping all privileged ports, but it seems just those. Opening a WebSocket to netcat dumps out a HTTP request, so it seems unlikely that you'd be able to talk with anything that doesn't talk HTTP and WebSockets. Firefox also seemingly blocks access to 192.168/24 and 10/8.

This makes me less angry. But what STILL make me angry is that I have to sit and research about some stupid thing that I don't want and can't turn off. Sooner or later, some web dev is gonna argue that all sites should be loaded over WebSockets because his bloated javascript stack performs marginally better, and then WebSockets won't be something I can turn off. Websites will just whitepage.

Edit 4: Done researching this now. I went to ebay on Firefox, and wasn't getting websocket scans. But I've got a stack of uBlock and NoScript... maybe that's interfering with it some how? Opened up a stock config for google-chrome -- that's my browser for "some dumb new web tech that isn't working in Firefox" -- not seeing any scans when I open up inspector and click "WS".

Regardless, his point still stands. You can totally use WebSockets as a port scanner for localhost, assuming the Content Security Policy allows it. Now I gotta go update my nginx configs...

Re:Why Is This Website Port Scanning Me? by derefr on Wednesday May 20, 2020 @12:11PM (#23248568)
> WebSockets ... haven’t ever wanted to use those. Ever. For anything. For any reason.

You’ve never used a web-app chat client?

> WebBluetooth

APIs like these don’t exist for the sake of regular unprivileged web-apps. They exist for the sake of browser extensions (or browser “apps”, or apps within a browser-projector like Electron), specifically in order to be used to add driver-like or service-like capabilities to devices like Chromebooks where the browser is the OS.

Re:Why Is This Website Port Scanning Me? by gsnedders on Wednesday May 20, 2020 @12:35PM (#23248881)
> APIs like these don’t exist for the sake of regular unprivileged web-apps. They exist for the sake of browser extensions (or browser “apps”, or apps within a browser-projector like Electron), specifically in order to be used to add driver-like or service-like capabilities to devices like Chromebooks where the browser is the OS.

That's not really true, though: they're part of the Chrome team's belief in not limiting the capabilities of the web as a platform for app development (on the basis of "if you lack one feature the app needs, the entire app ends up native"). This is a large part of Project Fugu: https://developers.google.com/web/updates/capabilities

Re:Why Is This Website Port Scanning Me? by upofadown on Wednesday May 20, 2020 @01:11PM (#23249282)
>You’ve never used a web-app chat client?

BOSH? Awkward, but it works without websockets.

* https://en.wikipedia.org/wiki/BOSH_(protocol)

Re:Why Is This Website Port Scanning Me? by nemothekid on Wednesday May 20, 2020 @08:48PM (#23253733)
BOSH is essentially long polling which is pretty difficult to scale (the worst case scenario can become 1 connection per message for a single client).

I'm pretty surprised however, that a nearly 10 year old standard is being considered as "superflous" as newer technology like WebBluetooth and WebUSB. What we had before Websockets wasn't really long polling, it was Flash.

Re:Why Is This Website Port Scanning Me? by bcrosby95 on Wednesday May 20, 2020 @12:21PM (#23248699)
Before websockets webapp chat features would use long polling. Not sure if all current ones require websockets or if they have a fallback mechanism.
Re:Why Is This Website Port Scanning Me? by derefr on Wednesday May 20, 2020 @12:23PM (#23248731)
Before websockets, webapp chat features—as implemented by your average web-backend programmer—couldn’t pass the C10K challenge.

Yes, fundamentally, on a technical level, there’s not much difference between holding open an HTTP connection in long-polling, vs. holding open a websocket connection.

But the abstractions presented by webserver gateway interfaces (e.g. CGI, prefork process-per-connection language-module embeds), languages/web frameworks (e.g. Ruby on Rails), and platforms (e.g. Heroku) back then, just didn’t support long polling efficiently.

HTTP backends, back then, were all built on an assumption of serialized queuing of HTTP requests—with each web server/web stack/worker thread serving requests one-at-a-time, getting each request out of the way as quickly as possible. There was no concept of IO asynchrony. Web servers were request loops, not event reactors. Libuv didn’t exist yet; nginx didn’t exist yet. The standard web server was Apache, and Apache couldn’t “yield” from a request that was idle.

And, as such, providers like Heroku would queue at the load-balancer, and only proxy a single open request to your web backend at a time, under the presumption that it wouldn’t be able to handle concurrent load. So you had to pay for 2x the CPUs (e.g. Heroku “dynos”) if you wanted to be able to hold 2x the connections open!

Entire third-party businesses (e.g. https://pusher.com/) were built around the hosting of custom web servers that were written in an event-driven architecture, and so were able to host these pools of long-polling connections. But they were freakin’ expensive, because even they didn’t scale very well.

Eventually, it was realized that the just-introduced Node.js could do IO asynchrony pretty well, and people started building explicit “websocket servers” in Node, culminating in the https://socket.io/ library. Back then, you couldn’t just put your regular HTTP load-balancer in front of your websocket backend, because your regular HTTP load-balancer almost certainly didn’t support held-open connections. You needed to host socket.io on a separate host/port, directly open to the internet. (This was one of the driving forces of Node’s adoption: as long as you were putting a Node app directly on the Internet, you may as well just put the rest of your HTTP app in there as well, and make the “websocket backend” into your whole backend.)

Sure, these days, every backend, load-balancer, and NAT middlebox can handle long-polling just fine. But we got there with a decade of struggle, and “legacy”-but-not-really code that used WebSockets because they guaranteed the semantics that long-polling couldn’t.

(I should mention, though, that WebSockets still have some advantages in the modern environment; namely, idle WebSockets are known to be idle at the runtime level, and so, unlike with a long-polling HTTP request, a mobile device can relax its wakeup-timer intervals when the only network connections it’s holding open are idle WebSockets.)

Re:Why Is This Website Port Scanning Me? by reaperducer on Wednesday May 20, 2020 @06:26PM (#23252704)
You’ve never used a web-app chat client?

Nope. Not once. And I've been using the web since Mosaic.

I see business web sites offering to chat with me all the time. I ignore them. If I want to chat, I'll let you know.

Apple's business-to-Messages thing works so well, I hope it puts the scammy webchat companies out of business.

Re:Why Is This Website Port Scanning Me? by derefr on Wednesday May 20, 2020 @07:15PM (#23253133)
I didn't mean the "chat with us now" engagements widgets; I meant, like, Google Hangouts, or Slack, or Twitch chat, or even an pre-Google-Docs Etherpad sidebar chat.

Though, honestly, I prefer the web-chat customer service for my bank/cellphone provider/etc. to calling them on the phone. I don't want to wait an hour on hold with my phone using up both battery and minutes; I want to just leave a window open on my computer and have it ding when they're ready.

Re:Why Is This Website Port Scanning Me? by neurostimulant on Wednesday May 20, 2020 @05:11PM (#23251844)
> You’ve never used a web-app chat client?

A decade ago people use comet for this, with php and apache! Every single ongoing comet connection occupy an apache process, a significant resource hog, yet people still use it because they have no other choice. These days we have websocket but I bet comet can be implemented with minimal resource penalty these days thanks to proliferation of async webserver support in modern backend stacks.

Re:Why Is This Website Port Scanning Me? by datenwolf on Wednesday May 20, 2020 @10:49AM (#23247491)
You forgot WebUSB – I wish I was joking, but I'm not:

https://developer.mozilla.org/en-US/docs/Web/API/USB

Re:Why Is This Website Port Scanning Me? by r00fus on Wednesday May 20, 2020 @12:33PM (#23248860)
I see WebUSB and I immediately think: "This is something that already exists in ChromeOS and Google wants to standardize it".

Chrome the browser is a stalking horse/test harness for ChromeOS.

Re:Why Is This Website Port Scanning Me? by edoo on Wednesday May 20, 2020 @11:16AM (#23247882)
I see irony in all this web functionality.

Back in the 90's if you wanted an ohms law calculator you had to go download a poorly written program from some random website. Network admins started locking down what you could download, run, and install due to security problems. Flash became a hit and they started piling on features in the browser so you could run things dynamically without having to download something.

Fast forward almost 30 years and the browser has become so full featured it is practically a weak OS sandbox that allows you to run just about anything. It was originally being extended to avoid that in the first place, and here we are almost back to square one.

Re:Why Is This Website Port Scanning Me? by wongarsu on Wednesday May 20, 2020 @12:28PM (#23248789)
The browser is basically the reinvention of the operating system. Its huge advantage is that it's built on the assumption that the user is trusted and the code isn't. In contrast most operating systems are designed on the assumption that code is absolutely trusted, but the user isn't. That's why rights management in Windows is concerned with who's allowed to access which file, while rights management in Firefox is concerned which which website is allowed to access the Webcam.

The big disadvantage of the browser is of course that there's huge competitive pressure, and most users prefer usability over security. Keeping things secure without asking the user about their intentions every step is a huge challenge (see also Windows UAC, which struggles with the same problem).

Re:Why Is This Website Port Scanning Me? by jadell on Wednesday May 20, 2020 @01:17PM (#23249346)
> Its huge advantage is that it's built on the assumption that the user is trusted and the code isn't. In contrast most operating systems are designed on the assumption that code is absolutely trusted, but the user isn't.

It's not necessarily an advantage, it's just a different threat model. An OS is protecting against an attacker already having access to the system (whether physically or over network.) The assumption is that the system is working properly and it's the operator that is malicious.

For the browser, the assumption is that the operator is working properly, but the systems they will be accessing are malicious.

The browser security measures are like a guard at the castle gate, allowing or preventing people from entering. The OS security is like locks on the doors inside the castle so that only people with the right keys can get into various protected rooms.

Both are necessary because they're preventing different things (access to the system vs. access once you're already inside the system.)

Re:Why Is This Website Port Scanning Me? by abakker on Wednesday May 20, 2020 @12:13PM (#23248595)
yes, because for most user choosing between security and functionality is not a choice they are prepared to reason about.

I'm no expert, but I am computer savvy. My experience is that more security ALWAYS limits functionality that I want. I get around it all with VMs and snapshots. I have totally wide open VMs that have no host access and just reset to the snapshot when I shut them down. the irony is that it is not only harder to choose functionality today, when you want it, but also harder to choose security. The choices are made for you. it is infuriating.

Re:Why Is This Website Port Scanning Me? by coronadisaster on Wednesday May 20, 2020 @02:00PM (#23249841)
dont these features allow web apps to compete with native mobile apps? I really don't like the app or play store... so if that is one way to get away from them, that is a good thing.
Re:Why Is This Website Port Scanning Me? by bjt2n3904 on Wednesday May 20, 2020 @10:51AM (#23247516)
...we are screwed.
Re:Why Is This Website Port Scanning Me? by jackewiehose on Wednesday May 20, 2020 @10:39AM (#23247357)
There is media.peerconnection.enabled in about:config. When set to false, WebRTC doesn't work but I'm not sure if there isn't anything left active.

Also uBlock has an option "Prevent WebRTC from leaking IP adresses".

WebRTC should be disabled by default or firefox should ask explicitly like with webcam-access.

There have already been reports where sites use your browser as a peer in a P2P-network (without your consent). This can be really problematic depending on where you live.

Re:Why Is This Website Port Scanning Me? by basro on Wednesday May 20, 2020 @01:24PM (#23249425)
Browsers no longer leak local ip addresses, there's a new feature that uses mDNS instead of local ips.
Re:Why Is This Website Port Scanning Me? by jimmaswell on Wednesday May 20, 2020 @11:05AM (#23247718)
> Prevent WebRTC from leaking IP adresses

A local IP?

Re:Why Is This Website Port Scanning Me? by Cactus2018 on Wednesday May 20, 2020 @11:48AM (#23248284)
FYI about these two websites that demonstrate the various data your browser shares:

https://browserleaks.com/

https://webkay.robinlinus.com/

Re:Why Is This Website Port Scanning Me? by Reelin on Wednesday May 20, 2020 @11:13AM (#23247831)
Yes, oddly enough. It can be used by a website you visit to gain information about your local network which turns out to be incredibly effective for fingerprinting.
Re:Why Is This Website Port Scanning Me? by fr2null on Wednesday May 20, 2020 @12:09PM (#23248541)
WebRTC can also leak your IP when you're hiding behind a VPN.
Re:Why Is This Website Port Scanning Me? by hanniabu on Wednesday May 20, 2020 @01:50PM (#23249730)
Any way to stop that?
Re:Why Is This Website Port Scanning Me? by mirimir on Wednesday May 20, 2020 @11:56PM (#23254649)
The best solution is running the VPN client in your router. That way, your machine can't see its ISP-assigned public IP address.

If you're using a workspace VM, you can run the VPN client in a pfSense VM, which is functionally equivalent.

If you're not using a workspace VM, and can't run the VPN client in a router, you can run the VPN client in a pfSense VM. You bridge the WAN interface of the pfSense VM to the host LAN adapter. So then the host can't use it. And you configure the LAN interface of the pfSense VM as host-only. So now the host machine (your workspace) can reach the Internet only through the VPN client in the pfSense VM.

Or you can just make sure that WebRTC is disabled.

Re:Why Is This Website Port Scanning Me? by djsumdog on Wednesday May 20, 2020 @10:43AM (#23247409)
Websockets are nice for some things. I hack on Mastodon and it uses WSS for streams and they're very helpful.

But WebBluetooth, ASM, etc are all fairly insane. WebRTC feels like a massive security issue (I've seen a demo of someone using WebRTC to find computers on an internal network at a security conference years ago. Even if that hole is fixed, it's still a hacky solution to video streaming behind NAT).

I agree; most of this stuff needs to have ways to disable it, in the base configuration screen of the browser (not hidden somewhere in about:config).

Re:Why Is This Website Port Scanning Me? by klodolph on Wednesday May 20, 2020 @11:10AM (#23247782)
Why is ASM insane? Are you talking about WASM? That’s got the same security model as JavaScript.
Re:Why Is This Website Port Scanning Me? by neurostimulant on Wednesday May 20, 2020 @03:15PM (#23250616)
WASM is great peace of tech but I can't help to think it would be abused a lot in the future. For example, right now we can use ad blocker to block ads and analytics by blocking its js from loading. Imagine when wasm gains mainstream popularity and ad companies begin to ship their ads and analytics product as a libaries to be linked at compile time. How do we block something like that? Sure the adblocker can hide the relevant dom contents, but the code is still run and doing whatever it want on your browser.
Re:Why Is This Website Port Scanning Me? by klodolph on Wednesday May 20, 2020 @04:13PM (#23251223)
These kind of complaints are based on a misunderstanding of how JS works or how the browser works.

You can do the same exact thing in JS right now. In fact, if anything, JavaScript makes this way easier than WASM. With JS, you can just use something like Rollup or Webpack to put your analytics code in the same code.

Re:Why Is This Website Port Scanning Me? by neurostimulant on Wednesday May 20, 2020 @04:53PM (#23251666)
Yeah but using webpack is not how majority of websites deployed, so it's probably not worth the effort for ads companies to support it. They will consider this when webpack/wasm become mainstream enough (approaching 50% web), which may or may not happen. Probably won't happened but the thought always linger in my mind.
Re:Why Is This Website Port Scanning Me? by klodolph on Wednesday May 20, 2020 @10:07PM (#23254184)
WASM is way less popular than Webpack.

Almost every site with some kind of front-end framework like React will use a bundler of some kind.

Re:Why Is This Website Port Scanning Me? by engineeringwoke on Thursday May 21, 2020 @07:10AM (#23256997)
It's easy to first party ad code. I would guess that as a percentage of website usage Webpack, or at least code that uses custom bundling, is over 50%. JS knows all.
Re:Why Is This Website Port Scanning Me? by saagarjha on Wednesday May 20, 2020 @04:48PM (#23251606)
Turing strikes again…
Re:Why Is This Website Port Scanning Me? by saagarjha on Wednesday May 20, 2020 @04:47PM (#23251597)
A stronger one, actually, since it can't access a bunch of stuff.
Re:Why Is This Website Port Scanning Me? by garmaine on Wednesday May 20, 2020 @11:36AM (#23248141)
Which is where the trouble started.
Re:Why Is This Website Port Scanning Me? by Sargos on Wednesday May 20, 2020 @12:00PM (#23248438)
Anyone who has enough technical knowledge to have a reason to turn these off should be just fine with about:config. We don't want a situation where normal users just randomly go into the config turning things off because they think they are doing something good. That's how we get another group of low-tech "turn off Windows Update" types who just harm themselves as a result of their incompetence.
Re:Why Is This Website Port Scanning Me? by bottled_poe on Wednesday May 20, 2020 @12:04PM (#23248490)
I think people turned those updates off for good reason... but it wasn’t the users that were incompetent.
Re:Why Is This Website Port Scanning Me? by mindslight on Wednesday May 20, 2020 @12:03PM (#23248481)
Anyone who has enough technical knowledge to have a reason to turn these on should be fine with about:config. The default settings should be secure.
Re:Why Is This Website Port Scanning Me? by Reelin on Wednesday May 20, 2020 @11:09AM (#23247778)
> Even if that hole is fixed ...

Last I checked (> 1 year ago) it was WONTFIX because of some very idiotic (IMO) reasoning. I keep it permanently disabled and have never missed it (media.peerconnection.enabled in Firefox btw).

Re:Why Is This Website Port Scanning Me? by rhizome on Wednesday May 20, 2020 @12:43PM (#23248979)
No doubt like canvas, font, audio, etc. fingerprinting, it will eventually be required to use Google apps like Maps and Messages for Web (to cite two recent discoveries).

"If you're not paying, you're the product" has its own form of economic inflation.

Re:Why Is This Website Port Scanning Me? by bradly on Wednesday May 20, 2020 @12:14PM (#23248612)
> I hack on Mastodon and it uses WSS for streams and they're very helpful.

I'm not familiar with Mastodon or WSS. Can you describe how using WSS make the end user's experience better? What would be different if web sockets weren't used?

Re:Why Is This Website Port Scanning Me? by djsumdog on Wednesday May 20, 2020 @12:32PM (#23248851)
Mastodon is a federated/distributed social networking server that communicates with other servers via a protocol called ActivityPub. The interface feels sorta like Twitter, but it doesn't have to be.

There are other FOSS ActiviyPub servers such as Pleroma (written in Elixir), Pixelfed (Instagram type interface) and PeerTube (distributed video). ActivityPub is a protocol (like e-mail/SMTP) for subscribing and replying to posts. ActiviyPub is just used for the backend (how servers communicate with other servers; like SMTP sending e-mail or RSS readers polling RSS).

Mastodon uses websockets to stream posts to the client/web browser. People who make mobile apps and desktop clients also tend to use WSS. It does fall back to regular HTTP polling in case WSS fails. Pleroma and others also re-implement the mastodon API. It means you can have different front-end web clients (Pleroma-fe, soapbox-fe, etc) on top of different backends (Mastodon/Pleroma).

The advantage of WSS is being able to stream new statuses with a socket, rather than polling constantly for new updates.

If you get on a Mastodon/Pleroma/Pixelfed instance (there are hundreds out there or you can setup your own), you can follow me at @[email protected]

Re:Why Is This Website Port Scanning Me? by bradly on Wednesday May 20, 2020 @04:19PM (#23251290)
Thank you for the explanation.
Re:Why Is This Website Port Scanning Me? by snisarenko on Thursday May 21, 2020 @12:08AM (#23254698)
I built a simple aggregator to give people a preview of mastodon

https://mastodonia.club

Re:Why Is This Website Port Scanning Me? by computerex on Wednesday May 20, 2020 @12:15PM (#23248632)
WebAssembly is awesome! It's a substantial performance boost, and will allow the off-loading of standards to open-source communities so browser developers can focus on core browser features rather than having to stretch themselves.
Re:Why Is This Website Port Scanning Me? by folmar on Wednesday May 20, 2020 @07:09PM (#23253077)
Also js_of_ocmal does a great job, i.e. you can usually run a CLI application in browser with zero changes.
Re:Why Is This Website Port Scanning Me? by JoshTriplett on Wednesday May 20, 2020 @01:32PM (#23249511)
The subset of web technologies that seems reasonable to any given speaker often closely matches the subset of web technologies the speaker uses (either for their own code, or in apps they use).

Personally, I'm looking forward to the point that web apps are capable enough to let PWAs do absolutely anything an Android or iOS application could do.

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.

Re:Why Is This Website Port Scanning Me? by fxtentacle on Wednesday May 20, 2020 @10:58AM (#23247611)
Web browsers really are the new operating systems.

Chrome OS was far ahead of its time, both in its general user hostility and in its excessive resource consumption for seemingly mundane tasks. Like when your roommate's YouTube streaming makes your Excel-like app horribly slow, because your new spreadsheet app needs high-speed internet for no obvious reason.

BTW, WebRTC and WebAssembly were great for crypto mining trojans embedded into ads. Before, they had to port their crypto miner to JavaScript by hand. By now, you can just cross-compile it. The progress of technology ... helps only the technology, but not you, the disposable user in front of the screen :p

Re:Why Is This Website Port Scanning Me? by detaro on Wednesday May 20, 2020 @12:14PM (#23248605)
> Before, they had to port their crypto miner to JavaScript by hand

No, cross-compilers to JS are and were thing too, and were used by cryptominers.

Re:Why Is This Website Port Scanning Me? by fxtentacle on Wednesday May 20, 2020 @12:16PM (#23248641)
Yes, but before webrtc they were easy to block.
Re:Why Is This Website Port Scanning Me? by detaro on Wednesday May 20, 2020 @12:19PM (#23248676)
What do cryptominers need WebRTC for?
Re:Why Is This Website Port Scanning Me? by fxtentacle on Wednesday May 20, 2020 @01:01PM (#23249178)
To connect to arbitrary IPs and ports to send home the results of the calculations.
Re:Why Is This Website Port Scanning Me? by zlsa on Wednesday May 20, 2020 @01:33PM (#23249538)
Which can be done with HTTP as well.
Re:Why Is This Website Port Scanning Me? by fxtentacle on Wednesday May 20, 2020 @01:56PM (#23249802)
Yes, but that is A LOT easier to filter and detect, because then it'll be using the XHR API and HTTP protocol, whereas WebRTC allows free-form protocols.
Re:Why Is This Website Port Scanning Me? by TomMarius on Wednesday May 20, 2020 @11:55AM (#23248383)
You can't cross compile anything other than crypto miners or how does it not help anything else?
Re:Why Is This Website Port Scanning Me? by fxtentacle on Wednesday May 20, 2020 @12:15PM (#23248633)
Most of the other uses are pointless.

I don't need WebRTC for chat, because IRC is still working just fine.

I don't need WebRTC for video calls, because Skype is still working just fine.

I don't need WebRTC and WebAssembly for online gaming, because I have Steam to install games locally. Plus latency and performance of games emscripten-ed to wasm tends to be atrocious.

So the only uses where I have seen the new Web* APIs in my life was obnoxious ads and newspaper websites trying to shove recommendations and notifications into my face.

What would you want to cross-compile that couldn't be done much better by building a proper local app?

Re:Why Is This Website Port Scanning Me? by fxtentacle on Wednesday May 20, 2020 @01:18PM (#23249353)
Plenty of downvotes, but no productive suggestion of what use-case would be best served with WebRTC ...
Re:Why Is This Website Port Scanning Me? by seangrogg on Wednesday May 20, 2020 @01:54PM (#23249776)
WebRTC enables many of these things on the browser. That is the point. So your "I don't need WebRTC because I use native apps" is basically just "I don't need the internet because I can go next door to talk to my neighbors".

Just because something doesn't have value for you does not suggest it does not have value, period.

Re:Why Is This Website Port Scanning Me? by fxtentacle on Wednesday May 20, 2020 @02:17PM (#23250025)
Almost. I'd say my argument is "I don't care about an online egg retailer shipping from China, because using the local supermarket is better in every way."

And obviously, Skype and IRC use the internet, too. So what is the benefit to me - the user - of "Skype inside web browser" over "Skype separate of web browser"?

I understand that WebRTC makes "Skype inside web browser" possible, but it also makes a lot of less desirable behavior possible. So there is be a trade-off between the advantages and the risks from adding WebRTC.

Which benefit does WebRTC generate for the user? I.e. why is it a good thing that web browsers added this?

Re:Why Is This Website Port Scanning Me? by TomMarius on Wednesday May 20, 2020 @02:44PM (#23250296)
That's just a matter of browser software. The Web platform should not suffer just because the browser is imperfect. You can write your perfect browser, fairly easily with the libraries available. I will try when I have some time.
Re:Why Is This Website Port Scanning Me? by typ on Wednesday May 20, 2020 @11:53AM (#23248343)
Strictly speaking, it is more like the shell of the distributed operating system.
Re:Why Is This Website Port Scanning Me? by Minor49er on Wednesday May 20, 2020 @12:17PM (#23248652)
Which is also funny because, if I remember correctly, IE was deeply integrated into Windows Explorer and the desktop was essentially rendered by the browser. I remember being able to even change my wallpaper to a custom HTML page in Windows
Re:Why Is This Website Port Scanning Me? by giantrobot on Wednesday May 20, 2020 @11:45AM (#23248244)
Hey, refID af64e30y, get back to looking at ads while your browser mines cryptocoins! We'll be watching!
Re:Why Is This Website Port Scanning Me? by the8472 on Wednesday May 20, 2020 @10:32AM (#23247249)
> So what, does Firefox need a freaking iptables implementation now?

umatrix is the layer7 firewall you're looking for, it can block websocket connections, cross-domain ones in particular are quite easy.

Re:Why Is This Website Port Scanning Me? by djsumdog on Wednesday May 20, 2020 @10:45AM (#23247445)
I've had performance issues with umatrix. I tried blocking all JS by default and explicitly enabling scripts. In theory that should make the browser preform better. I suspect there are a bunch of sites that can't run a function or reach a JS resource and then just go into spin loops eating through resources .. either that or the blocking itself is resource intensive.
Re:Why Is This Website Port Scanning Me? by OJFord on Wednesday May 20, 2020 @11:10AM (#23247783)
> I suspect there are a bunch of sites that can't run a function or reach a JS resource and then just go into spin loops eating through resources

Google Maps.

Re:Why Is This Website Port Scanning Me? by the8472 on Wednesday May 20, 2020 @10:57AM (#23247598)
blocking has non-zero cost, yes. especially if complex whitelists need to be evaluated for every request. but at least for me it still is a net win most of the time.

But you can also operate umatrix in a blacklist-based approach, i.e. simply let most requests through except the categories you deem problematic (e.g. cross-site websockets in this case)

Re:Why Is This Website Port Scanning Me? by anon_cow1111 on Wednesday May 20, 2020 @12:24PM (#23248741)
>So I don't have the time to investigate every new fad when it comes out

I'm finding this to be my main problem. I have a fairly solid computer repair/troubleshooting background but can't keep up with the layers of crap that are pasted on top of modern software.

An ongoing list of "features" being added to web browsers and how to get rid of them would be hugely helpful, but I've never found a centralized site for this topic, it's all just scattered around various tech sites.

Re:Why Is This Website Port Scanning Me? by craftinator on Wednesday May 20, 2020 @10:51AM (#23247520)
Whatever happened to a control panel to turn off all of the things you Don't Want? All of these protocols should have triple toggle switches, Enabled, Ask, Disabled. If something on the page doesn't load because that protocol is disabled, it logs to the console so you can turn on what you need for that page.

I get that adding lots of user controls makes state management difficult, but there are tried and true ways to do this; users need the browser to work for them, not the other way around.

Re:Why Is This Website Port Scanning Me? by jschwartzi on Wednesday May 20, 2020 @11:12AM (#23247826)
Firefox is open-source, so you could add that. I would really appreciate being able to turn WebUSB WebBluetooth and WebRTC off entirely as those expose a lot of devices that I need not to be exposed to the Internet.
Re:Why Is This Website Port Scanning Me? by michaelt on Wednesday May 20, 2020 @12:23PM (#23248721)
I'm pretty sure someone at Firefox has decided the settings panel should be 'clean' and 'easy to use' rather than providing maximum control.

I mean, there's a lot in about:config that the settings panel doesn't support.

Re:Why Is This Website Port Scanning Me? by folmar on Wednesday May 20, 2020 @06:56PM (#23252971)
... and it was around the time when Firefox 3 was introduced.
Re:Why Is This Website Port Scanning Me? by thinkmassive on Wednesday May 20, 2020 @11:35AM (#23248129)
The ability to selectively enable those features would be ideal, but I disagree that their presence alone is a net negative.

Web browsers are the new cross-platform runtime, better to get used to it.

Re:Why Is This Website Port Scanning Me? by Wowfunhappy on Wednesday May 20, 2020 @02:13PM (#23249975)
I realize Hacker News isn't a hivemind, but I see these two assertions frequently, and I find the contradiction striking:

1. Why are web browsers becoming application platforms? Web browsers are document readers, and we should treat them as such.

2. Why does Zoom (or Slack, or insert-thing-here) want me to download a native app? I should be able to do it in my web browser!

I sympathize with both philosophies, but they cannot co-exist.

Re:Why Is This Website Port Scanning Me? by dullgiulio on Wednesday May 20, 2020 @02:27PM (#23250111)
Nope, this is a strawman argument you're making.

Parent is asking for granular access control over these very advanced and double-edged features, which is a perfectly valid request.

Having permissions is the norm for native apps on mobile, and it's slowly becoming the norm also on desktop, finally.

Browsers are the new OS, they have to implement permissions too without anything enabled by default.

Re:Why Is This Website Port Scanning Me? by asveikau on Wednesday May 20, 2020 @11:50PM (#23254621)
Actually I think there's middle ground or a way to somewhat satisfy both.

Does Zoom, Slack, or insert-thing-here need the technical ability to portscan localhost in the manner of this blog post? Well, Zoom had their vulnerability making web requests to their app bound to localhost, but did they need to be able to do it? They could get the job done without that functionality.

They already have both an app and a web-only experience. (They try to hide the latter by only presenting the option when the former has evidently failed, but it's still there.) So, it has it both ways by your 1 & 2. Almost as if users should be able to choose.

Re:Why Is This Website Port Scanning Me? by lqet on Wednesday May 20, 2020 @10:49AM (#23247488)
> Opening a WebSocket to netcat dumps out a HTTP request, so it seems unlikely that you'd be able to talk with anything that doesn't talk HTTP and WebSockets.

AFAIK this is only partly true, if the web server does not support the websocket protocol, you cannot connect to it [0].

So if I am understanding this correctly, WebSockets only support a small subset of HTTP and it should therefore not be possible to use them to connect to "classic" HTTP servers or to send GET or POST requests to it.

[0] https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_...

Re:Why Is This Website Port Scanning Me? by cygx on Wednesday May 20, 2020 @01:12PM (#23249290)
But you still have to make sure all programs bound to local ports handle WebSocket requests gracefully.

Binding to 127.0.0.1 is a nicely cross-platform way to do inter-process communication (I've done so in the past to mitigate JVM startup/warmup issues).

I've never written this code defensively, because if you run programs that throw random shit at locally-bound ports, that's your responsibility. The web community has decided it's a good idea to give arbitrary websites that capability. It's true that the 'random shit' may only take the form of WebSocket requests, but this is only a minor comfort.

From my perspective, this needs to be locked down.

edit: On second thought, you have always been able to trigger similar requests by e.g. just setting the src attribute of an image: Opera aside, browsers apparently never implemented proper cross-network protections. So from now on, I'll be extra careful to make sure all my servers can handle unexpected, potentially malicious HTTP requests even when bound to 127.0.0.1.

That said, I still do think this is something that needs fixing on the browser-side.

Re:Why Is This Website Port Scanning Me? by jwandborg on Wednesday May 20, 2020 @11:33AM (#23248101)
WebSocket connections are initialized by sending an HTTP request.
Re:Why Is This Website Port Scanning Me? by u801e on Wednesday May 20, 2020 @11:13AM (#23247837)
> Firefox also seemingly blocks access to 192.168/24 and 10/8.

What about 172.16.0.0/12?

Re:Why Is This Website Port Scanning Me? by m463 on Friday May 22, 2020 @04:38AM (#23269883)
I remember when you could have a link to file:///etc/passwd and you could click on it, and the browser would load it.
Re:Why Is This Website Port Scanning Me? by pdonis on Wednesday May 20, 2020 @11:48AM (#23248286)
It blocks that too on my machine.
Re:Why Is This Website Port Scanning Me? by pdonis on Wednesday May 20, 2020 @11:50AM (#23248310)
> Firefox also seemingly blocks access to 192.168/24 and 10/8

Chrome, OTOH, will happily open a websocket to these IP ranges. Another good reason not to use Chrome.

Re:Why Is This Website Port Scanning Me? by dragonwriter on Wednesday May 20, 2020 @10:50PM (#23254378)
> Chrome, OTOH, will happily open a websocket to these IP ranges. Another good reason not to use Chrome.

Why is “I can use websockets on a private network” a bad thing?

Re:Why Is This Website Port Scanning Me? by kchr on Wednesday May 20, 2020 @12:11PM (#23248572)
Uh... Why not block all private networks?
Re:Why Is This Website Port Scanning Me? by ac29 on Wednesday May 20, 2020 @01:33PM (#23249529)
A search seems to suggest Chromecast devices are controlled via websocket, though that information is pretty old.
Re:Why Is This Website Port Scanning Me? by foobiekr on Wednesday May 20, 2020 @12:20PM (#23248691)
Probably IoT.
Re:Why Is This Website Port Scanning Me? by billme on Wednesday May 20, 2020 @12:20PM (#23248690)
>> “ Edit 4: Done researching this now. I went to ebay on Firefox, and wasn't getting websocket scans.“

...Just in case you missed it and you’re using Linux, from the article...

“I thought it might be because I run Linux, so I created a new Windows VM and sure enough, I saw the port scan occurring in the browser tools from the ebay home page”

Re:Why Is This Website Port Scanning Me? by louis_pasteur on Wednesday May 20, 2020 @10:44AM (#23247426)
We need a simple browser implementation for the masses. Is there any such browser in existence?
Re:Why Is This Website Port Scanning Me? by mcherm on Wednesday May 20, 2020 @10:47AM (#23247473)
There are no simple browsers, thus certainly no simple browser for the masses.
Re:Why Is This Website Port Scanning Me? by folmar on Wednesday May 20, 2020 @06:55PM (#23252964)
If you are on mobile there is Firefox Klar/Focus.
Re:Why Is This Website Port Scanning Me? by imiric on Wednesday May 20, 2020 @12:34PM (#23248867)
I'm a big fan of https://surf.suckless.org/ .

With some polish and maintenance it could serve as base for a simple(r) browser for the masses. It is essentially a small wrapper around WebKit, which is far from simple, but it has the benefit of great support for modern web features.

Re:Why Is This Website Port Scanning Me? by wronex on Wednesday May 20, 2020 @12:17PM (#23248643)
Agreed. Firefox99, latest Firefox but party like it's 1999. Web* disabled. Canvas disabled. LocalStorage disabled. DRM-content disabled. Anything else we don't need?
Re:Why Is This Website Port Scanning Me? by travisporter on Wednesday May 20, 2020 @01:45PM (#23249680)
You've inpsired me!

In Firefox:

LocalStorage - about:config Dom.storage.enabled

Canvas - block JS via noscript

DRM - Preferences->Disable DRM content checkbox

WebRTC - about:config media.peerconnection.enabled;

As a side note, noscript has been an eye-opener for how many things are loaded when I open anywebsite! It's been fast, but I've been getting annoyed by guessing what to enable to move past a blank webpage. And WTF is newrelic and why does half of my internet browsing use it?

Re:Why Is This Website Port Scanning Me? by neurostimulant on Wednesday May 20, 2020 @03:42PM (#23250887)
Newrelic is an application performance monitoring platform, basically give you performance insight on your webapp, so it gain popularity really fast. Really great for identifying performance bottleneck on the server side. Later on, they launched browser monitoring too, so now all webserver that uses newrelic automatically insert newrelic js analytics on every html endpoint.
Re:Why Is This Website Port Scanning Me? by mard on Wednesday May 20, 2020 @11:00AM (#23247632)
Netscape.
Re:Why Is This Website Port Scanning Me? by kchr on Wednesday May 20, 2020 @12:13PM (#23248596)
Qutebrowser.
Re:Why Is This Website Port Scanning Me? by Sargos on Wednesday May 20, 2020 @12:02PM (#23248468)
DOS is simpler than Linux. Lets go back to that.
Re:Why Is This Website Port Scanning Me? by have_faith on Wednesday May 20, 2020 @11:22AM (#23247961)
I don't think there's anything wrong with any of those things with a sane permissions system attached (strict opt in per site).

The web is now a no-install app delivery platform, it makes sense for these things to exist.

Re:Why Is This Website Port Scanning Me? by baybal2 on Wednesday May 20, 2020 @12:14PM (#23248616)
We are in ActiveX 2.0 era. Can we call it GoogleX?