News for hackers. Stuff that matters.
Re:Attacking Unix Systems via Cups, Part I by RGBCube on Thursday September 26, 2024 @04:05PM (#41662656)
Anyone exposing CUPS to the internet is living a level of not giving a fuck that CVEs cannot reach.
Re:Attacking Unix Systems via Cups, Part I by DanMcInerney on Thursday September 26, 2024 @04:15PM (#41662800)
It appears that the vulnerable service in question listens on 0.0.0.0 which is concerning, it means attacks from the LAN are vulnerable by default and you have to explicitly block port 631 if the server is exposed to internet.
Re:Attacking Unix Systems via Cups, Part I by gordonfish on Thursday September 26, 2024 @04:18PM (#41662843)
This is why on public servers I block everything inbound and only allow specific needed services through.
Re:Attacking Unix Systems via Cups, Part I by bongodongobob on Thursday September 26, 2024 @04:21PM (#41662870)
Who doesn't block all unneeded ports on an internet facing server or have it behind a firewall of some sort?
Re:Attacking Unix Systems via Cups, Part I by bshipp on Thursday September 26, 2024 @04:27PM (#41662950)
I guess the important question is whether or not these things are blocked by default or require user intervention to disable cups? Sure, many of us block all ports by default and either route everything behind a reverse proxy or punch very specific holes in the firewall that we know are there and can monitor, but someone firing up an ubuntu distribution for their first foray into linux is probably not thinking that way.
Re:Attacking Unix Systems via Cups, Part I by bongodongobob on Thursday September 26, 2024 @04:34PM (#41663034)
Well lots of people crash 600HP cars right after they buy them. If you haven't done your homework, you'll learn quickly.
Re:Attacking Unix Systems via Cups, Part I by bshipp on Thursday September 26, 2024 @04:39PM (#41663091)
The people who are crashing their 600HP Linux systems are, unfortunately, not the ones who are reading CVE listings in their spare time. Canonical and other distros are probably going to have to patch that default setting.
Re:Attacking Unix Systems via Cups, Part I by bongodongobob on Thursday September 26, 2024 @05:17PM (#41663499)
You don't need to read CVEs to turn on your fucking firewall. It's in every single how to set up a server for dummies tutorial I've ever seen.
Re:Attacking Unix Systems via Cups, Part I by sgc on Thursday September 26, 2024 @07:36PM (#41664730)
There are a lot of comments on here that assume Linux is only for servers. But just recently there was a post on HN indicating Linux will likely hit 5% desktop share for the first time this year. That's a lot of people on Linux - and a far higher percentage of people using Linux on the desktop will not know anything about this. Sane defaults should not be a luxury. Of course people should know to wear their seatbelts, but seatbelt alarms are still a very good thing.

Sent from my Ubuntu laptop.

Re:Attacking Unix Systems via Cups, Part I by Ekaros on Friday September 27, 2024 @01:58AM (#41666731)
And this is why Microsoft force pushes updates. I think when Linux desktops become really popular there is quite a worry if the users simply do not update them regularly enough. Or if they are not secured in most ways by default.
Re:Attacking Unix Systems via Cups, Part I by eikenberry on Thursday September 26, 2024 @04:24PM (#41662911)
Which distro do you see Cups listening on 0.0.0.0? On Debian (at least, only one I have handy) it only listens on localhost.

[edit: I was wrong, it listens on 0.0.0.0 for UDP. I was only checking TCP. ]

Re:Attacking Unix Systems via Cups, Part I by mikepavone on Thursday September 26, 2024 @04:33PM (#41663024)
On my Ubuntu 22.04 machine, cupsd itself is only listening on localhost, but cups-browsed (which is what has the vulnerability here) is listening on 0.0.0.0
Re:Attacking Unix Systems via Cups, Part I by raverbashing on Thursday September 26, 2024 @04:36PM (#41663056)
Why does it even listens in UDP at this day and age?!
Re:Attacking Unix Systems via Cups, Part I by mikepavone on Thursday September 26, 2024 @04:47PM (#41663175)
I believe it's implementing DNS-SD for network printer auto-discovery. I'm not terribly familiar with DNS-SD, but given that normal DNS is UDP based it would be unsurprising for DNS-SD to also use UDP.
Re:Attacking Unix Systems via Cups, Part I by ahoka on Thursday September 26, 2024 @06:16PM (#41664110)
DNS is actually UDP/TCP. It’s probably required for receiving unicast messages, if it’s using DNS-SD
Re:Attacking Unix Systems via Cups, Part I by ahoka on Thursday September 26, 2024 @06:14PM (#41664090)
To receive multicast messages, probably.
Re:Attacking Unix Systems via Cups, Part I by yrro on Friday September 27, 2024 @11:46AM (#41671955)
The purpose of cups-browsed is to listen on a UDP port which allows it to receive broadcasts from legacy cups servers on the local network, whereupon it will talk to cups and configure a local print queue for the printers on the discovered server.

A modern setup doesn't need it and doesn't use it.

Re:Attacking Unix Systems via Cups, Part I by bonzini on Thursday September 26, 2024 @04:31PM (#41662999)
OpenSUSE

But it looks like cups-browsed is only needed on the Internet; locally you only need mDNS.

Re:Attacking Unix Systems via Cups, Part I by tsimionescu on Friday September 27, 2024 @02:48AM (#41667091)
mDNS doesn't allow the printer to register itself to your system, which is the (highly dubious!) purpose of cups-browsed.
Re:Attacking Unix Systems via Cups, Part I by yrro on Friday September 27, 2024 @11:52AM (#41672060)
Modern cups discovered printers via mDNS and does indeed automatically create temporary destinations for them. This only works with "IPP Everywhere" printers which are 'driverless', i.e., the risk of doing this is limited since there's no printer model-specific software that needs to be run on the local machine to print to a remote printer, as opposed to the legacy protocol implemented (apparently unsafely!) by cups-browsed.
Re:Attacking Unix Systems via Cups, Part I by cp9 on Thursday September 26, 2024 @04:27PM (#41662947)
on popOS I see 0.0.0.0:*

I'm not sure why it deviates from Debian and Ubuntu which its based on though

Re:Attacking Unix Systems via Cups, Part I by jeffbee on Thursday September 26, 2024 @04:30PM (#41662986)
That's the wrong column of netstat output, I think. "0.0.0.0:*" stands in for the (non-existent) peer address of a listening port.
Re:Attacking Unix Systems via Cups, Part I by cp9 on Thursday September 26, 2024 @04:47PM (#41663177)
oh sorry yeah I copied the wrong column. the correct column is `0.0.0.0:631`
Re:Attacking Unix Systems via Cups, Part I by rini17 on Thursday September 26, 2024 @04:25PM (#41662933)
MX Linux
Re:Attacking Unix Systems via Cups, Part I by RGBCube on Thursday September 26, 2024 @04:24PM (#41662916)
I'm pretty sure all major distros configure it to listen locally instead.
Re:Attacking Unix Systems via Cups, Part I by mikepavone on Thursday September 26, 2024 @05:27PM (#41663591)
cupsd is configured to listen locally, but cups-browsed has to listen on the network to do its job (network printer auto-discovery)
Re:Attacking Unix Systems via Cups, Part I by gordonfish on Thursday September 26, 2024 @06:50PM (#41664392)
> but cups-browsed has to listen on the network to do its job (network printer auto-discovery)

Isn't listening on 0.0.0.0 instead of localhost only needed if the machine itself is hosting a printer that needs to be accessible to other hosts?

Re:Attacking Unix Systems via Cups, Part I by mikepavone on Thursday September 26, 2024 @08:32PM (#41665073)
I am very unfamiliar with the protocol, but my impression from a little reading is that the sharing computer broadcasts and the receiver listens. This appears to be for some CUPS specific browsing/discovery protocol rather than mDNS/DNS-SD (cups-browsed supports adding printers discovered that way but depends on avahi to handle the mDNS part).

EDIT: Here's a description of the protocol in question: https://opensource.apple.com/source/cups/cups-327/cups/doc/h...

Re:Attacking Unix Systems via Cups, Part I by tsimionescu on Friday September 27, 2024 @01:50AM (#41666675)
No, per the article, cups-browsed is used so that a printer can register itself to your system. The printer is the one that initiates a connection to tell your system that it is available at some URL.
Re:Attacking Unix Systems via Cups, Part I by btown on Thursday September 26, 2024 @04:43PM (#41663142)
If you're vulnerable to attacks from the LAN, you're vulnerable to your wi-fi router (or your coffee shop/workplace's router) being compromised, which is quite common; see e.g. https://www.bleepingcomputer.com/news/security/mirai-botnet-... and https://blog.lumen.com/the-pumpkin-eclipse/

Assuming that most routers are silently compromised, with their command-and-control operators just waiting for an exploit like this one, is almost par for the course these days!

Re:Attacking Unix Systems via Cups, Part I by runjake on Thursday September 26, 2024 @05:21PM (#41663532)
The problem: you're thinking in terms of home/small business networks.

The rest of us are thinking in terms of larger networks (in my case with hundreds of subnets and tens of thousands of nodes) where "631 is blocked at the firewall" isn't of much relief. The firewall is merely one, rather easy to get past, barrier. We're also concerned with east/west traffic.

Re:Attacking Unix Systems via Cups, Part I by btown on Thursday September 26, 2024 @06:32PM (#41664232)
For sure, and sending hug-ops to teams like yours that have to deploy & enforce mass patches! But I'm also thinking of environments that don't even have the benefit of a team like yours. https://issuetracker.google.com/issues/172222838?pli=1 is (or seems to be?) a saving grace, without which every school using Chromebooks could see worms propagating rapidly if even one student connected to a compromised router at home.
Re:Attacking Unix Systems via Cups, Part I by runjake on Friday September 27, 2024 @10:55AM (#41671246)
FWIW, my team is me and maaaybe 30% of another guy, but point noted. :-)
Re:Attacking Unix Systems via Cups, Part I by graemep on Friday September 27, 2024 @05:52AM (#41668251)
Would you also not block this at the firewall on individual nodes: if you block incoming incoming UDP on port 631 that would at least eliminate one of the two entry points, right?

There is no detail in the article about the other.

Re:Attacking Unix Systems via Cups, Part I by tsimionescu on Friday September 27, 2024 @06:35AM (#41668603)
The port has to be open on the node for the functionality to work - the whole point is that printers on the same LAN can auto-register. If you don't want that, disabling cups-browsed is much safer than just relying on the firewall. If you do want that, you can't firewall the port at all.
Re:Attacking Unix Systems via Cups, Part I by RGBCube on Thursday September 26, 2024 @04:07PM (#41662689)
I also cannot believe that this is the 9.9 rated CVE. For comparison, heartbleed was a 7.5. I was awaiting a Total Linux Meltdown at best and a collapse of the world economy at worst with the amount of hyping up and fearmongering that the author did on social media.
Re:Attacking Unix Systems via Cups, Part I by bogantech on Thursday September 26, 2024 @04:12PM (#41662753)
Link to the OP for those that haven't seen it: https://x.com/evilsocket/status/1838169889330135132

Hyped it up to be some massive thing but it turned out to be a massive nothingbuger for me at least

Re:Attacking Unix Systems via Cups, Part I by RGBCube on Thursday September 26, 2024 @04:15PM (#41662804)
Re:Attacking Unix Systems via Cups, Part I by maeln on Thursday September 26, 2024 @04:28PM (#41662958)
It's always funny to me how cybersecurity always seem to attract people with a ... certain sense of ego.
Re:Attacking Unix Systems via Cups, Part I by ChocolateGod on Thursday September 26, 2024 @05:55PM (#41663916)
> pretty much only got patronized because the devs just can't accept that their code is crap - responsible disclosure: no more.

I can think of another reason they got patronised.

Re:Attacking Unix Systems via Cups, Part I by evilos on Friday September 27, 2024 @12:57AM (#41666402)
They claim to not be a cybersecurity pro
Re:Attacking Unix Systems via Cups, Part I by NavinF on Thursday September 26, 2024 @04:14PM (#41662789)
Yeah tbh it's not as bad as he claimed. I doubt this is actually rated 9.9:

>A remote unauthenticated attacker can silently replace existing printers’ (or install new ones) IPP urls with a malicious one, resulting in arbitrary command execution (on the computer) when a print job is started (from that computer).

>WAN / public internet: a remote attacker sends an UDP packet to port 631. No authentication whatsoever.

>LAN: a local attacker can spoof zeroconf / mDNS / DNS-SD advertisements (we will talk more about this in the next writeup ) and achieve the same code path leading to RCE.

Still, sucks for linux desktop users. Looks like any random device on your wifi/vpn can screw you over

Re:Attacking Unix Systems via Cups, Part I by floren on Thursday September 26, 2024 @04:16PM (#41662808)
Or any malicious user on the airport wifi. The compromise will linger until however many weeks later when you decide to print something...
Re:Attacking Unix Systems via Cups, Part I by bremac on Thursday September 26, 2024 @04:35PM (#41663050)
Keep in mind that you still need send a print job to the fake printer to trigger the exploit. If you send the job to your real printer, nothing happens.
Re:Attacking Unix Systems via Cups, Part I by crote on Thursday September 26, 2024 @10:30PM (#41665702)
The exploit allows an attacker to overwrite your real printer with their fake printer.
Re:Attacking Unix Systems via Cups, Part I by graemep on Friday September 27, 2024 @05:55AM (#41668275)
Not using the "WAN" attack if you are using a firewall config that stops that on public wifi.

I do not understand how the mDNS entry point works.

Re:Attacking Unix Systems via Cups, Part I by rolph on Thursday September 26, 2024 @04:18PM (#41662839)
i knew there was a reason i blacklist unsolicited/unauthenticated UDP inbound.
Re:Attacking Unix Systems via Cups, Part I by amluto on Thursday September 26, 2024 @04:23PM (#41662904)
And, for some utterly and completely absurd reason, CUPS runs as a system daemon instead of a highly sandboxed user program.
Re:Attacking Unix Systems via Cups, Part I by throwanem on Thursday September 26, 2024 @04:32PM (#41663011)
It's a spooler for a printing system that supports concurrent job submission, potentially among multiple users. It's going to have to achieve serialization some kind of way.
Re:Attacking Unix Systems via Cups, Part I by aftbit on Thursday September 26, 2024 @04:43PM (#41663143)
Why does it need to run as `root` user and not `cups`?
Re:Attacking Unix Systems via Cups, Part I by throwanem on Thursday September 26, 2024 @04:53PM (#41663234)
As long as that user can talk to the printers' device nodes (and/or the network), it needn't so far as I know.

The original "system daemon vs. user program" dichotomy offers a much broader range of interpretations than this, though, and it was more the implication of "this can and should be an evanescent program invoked by individual users, implicitly persisting little or no state between invocations" to which I sought to object.

(That said, I take another nearby commenter's point regarding the need, and existence, of a more evanescent and safer option on systems that will never see more printing than one user does two or three times a year.)

Re:Attacking Unix Systems via Cups, Part I by stevekemp on Thursday September 26, 2024 @10:36PM (#41665733)
Binding to ports under 1024 traditionally requires root privileges. (These days of course that isn't quite as true as it used to be.)
Re:Attacking Unix Systems via Cups, Part I by amluto on Friday September 27, 2024 @12:05AM (#41666142)
Why on Earth do ordinary systems need CUPS binding to a port at all?
Re:Attacking Unix Systems via Cups, Part I by a96 on Friday September 27, 2024 @03:39AM (#41667402)
They don't need. Want, for listening to network printers announcing themselves. It's a very bad system, even then.
Re:Attacking Unix Systems via Cups, Part I by amluto on Friday September 27, 2024 @10:03AM (#41670631)
Have you ever seen a network printer announce itself by talking to a print daemon on port 631?

I’ve seen network printers announce themselves over DNS-SD/mDNS and over NetBIOS, AppleTalk, etc. All of those are a layer beneath the print daemon.

Re:Attacking Unix Systems via Cups, Part I by yrro on Friday September 27, 2024 @12:02PM (#41672206)
They don't. cups-browsed is a legacy component that isn't needed on ordinary systems, which outsource printer discovery to an mDNS service such as avahi.
Re:Attacking Unix Systems via Cups, Part I by ronjakoi on Friday September 27, 2024 @01:14AM (#41666497)
It's common practice to open the socket to start listening on the <1024 port, then drop the root privileges and continue as a different user.
Re:Attacking Unix Systems via Cups, Part I by cpach on Friday September 27, 2024 @08:17AM (#41669537)
On a modern Linux system, it’s better to use the CAP_NET_BIND_SERVICE capability instead. Then you don’t need to start the process as root at all.
Re:Attacking Unix Systems via Cups, Part I by yrro on Friday September 27, 2024 @12:00PM (#41672180)
I believe these vulnerabilities only allow RCE as the 'lp' user (which is able to access parallel ports and USB devices that identify themselves as printers). In addition the process will be confined by MAC policies (e.g., on Fedora/Red Hat I think they're confined by cupsd_t).
Re:Attacking Unix Systems via Cups, Part I by amluto on Friday September 27, 2024 @12:04AM (#41666138)
I have never, in the entire history of my usage of desktop systems, wanted my system to spool out a print job on behalf of a non-current user. Nor have I wanted my system to continue servicing my print queue after I log out. To the contrary: it’s incredibly annoying when the queue glitches out and then my print jobs show up in the printer tray after I’ve left.

On multi-user systems (accessed simultaneously by multiple interactive accounts), sure, I’ve once worked in a lab where multiplexing a printer would make sense. Make this a non-default option, please. And have a printer multiplexing daemon, not an entire shared monstrosity like CUPS.

On terminal-server style systems, the print system should be per user, because the printers are per user. I don’t want to print to a printer wherever the terminal server lives — I want to print to the printer near me.

I once ran an actual print server for a couple years. It did accounting, correctly, by wiring CUPS to a little program I wrote that actually spoke PJL correctly. CUPS, of course, can’t actually do this.

Re:Attacking Unix Systems via Cups, Part I by edelbitter on Thursday September 26, 2024 @05:06PM (#41663390)
On Ubuntu, both. A system daemon with interesting interactions with avahi-daemon and colord, and a somewhat sandboxed user program, just so Chrome is not overly inconvenienced by its snap sandboxing. But wait, there is more: The login & lock screen also runs the whole glory of GNOME.. to query printer settings. So you can have those sweet, sweet "new printer" notifications overlaid while inputting your password. Or whatever else "your" printer needs to add there.
Re:Attacking Unix Systems via Cups, Part I by jmclnx on Friday September 27, 2024 @01:10PM (#41673060)
FWIW, on OpenBSD, cups-browsed is not on my system, but there are some cups files.

But cups-browsed is installed when you install packages "net/avahi" and "print/libppd" which I do not know what either of them are.

So I guess on Linux avahi needs cups-browsed.

Re:Attacking Unix Systems via Cups, Part I by bshipp on Thursday September 26, 2024 @04:29PM (#41662979)
This is the worry. It seems like a really unnecessary privilege escalation.
Re:Attacking Unix Systems via Cups, Part I by jeffbee on Thursday September 26, 2024 @04:33PM (#41663023)
It's because of the frankly idiotic idea of persistent print queues. If you want to have this artifact that survives a user session, then the print subsystem needs super-user abilities.

ChromeOS does away with the whole idea. There are no persistent printer queues or jobs. Artifacts of the printing subsystem have lifetime tied to the user session.

Re:Attacking Unix Systems via Cups, Part I by funcDropShadow on Thursday September 26, 2024 @04:38PM (#41663080)
No, persistent print queues can be implemented without cups running as super-user.
Re:Attacking Unix Systems via Cups, Part I by gordonfish on Thursday September 26, 2024 @09:30PM (#41665401)
I'm a little confused why this is even an issue. Persistent queues have been an option since the days of Windows 9x.

Maybe it's a Gnome problem. KDE let's me see what I had previously printed if I want to see it, or reprint something.

I also know many people in pre-press who make good use of that.

Re:Attacking Unix Systems via Cups, Part I by amluto on Friday September 27, 2024 @12:05AM (#41666145)
Windows 9x printing was every bit as bad as CUPS.
Re:Attacking Unix Systems via Cups, Part I by gordonfish on Friday September 27, 2024 @08:50AM (#41669823)
The point was about the retention of print jobs in queue, that it was a concept and option since the mid 90s.
Re:Attacking Unix Systems via Cups, Part I by johnklos on Thursday September 26, 2024 @06:43PM (#41664321)
Anyone going to a coffee shoppe and using a public wifi is exposing CUPS and can be exploited. Simple minded dismissal doesn't help anyone.
Re:Attacking Unix Systems via Cups, Part I by gordonfish on Thursday September 26, 2024 @09:33PM (#41665413)
Honestly, this is why firewalls exist. This really isn't problem for anyone with basic computer hygiene.
Re:Attacking Unix Systems via Cups, Part I by zanecodes on Friday September 27, 2024 @12:22AM (#41666224)
The prevalence of attitudes like this in the Linux community is why the year of the Linux desktop will never come.

Imagine if your brand new refrigerator, by default, would leak toxic refrigerant into your kitchen unless you adjusted a valve just so. This fact is not called out prominently in the manual, but if you read the fine print in the manufacturer's assembly instructions and have a working knowledge of how a refrigerator operates, you can maybe infer that this valve must be adjusted after purchase to prevent leakage. You go on their support forum to try to figure out why your brand new refrigerator is emitting toxic refrigerant, and you're essentially called an idiot and told you don't have "basic refrigerator hygiene."

People don't want to become refrigerator mechanics. They want cold food.

Re:Attacking Unix Systems via Cups, Part I by abhinavk on Friday September 27, 2024 @12:35AM (#41666285)
Why isn't the firewall on by default on desktop systems?
Re:Attacking Unix Systems via Cups, Part I by snickerer on Friday September 27, 2024 @05:20AM (#41668001)
Because you don't need a firewall on a sensibly configured desktop computer.

If you have daemons that listen to incoming connections, you only want to run them if they are sane and secure.

A firewall makes sense when you don't trust the daemons in your lair, eh, network, and you don't have the possibility to replace insecure stuff with secure stuff. But a firewall must be maintained by experts.

For a single computer it is much easier: just make sure it is secure and don't add an extra layer of complexity to it.

Re:Attacking Unix Systems via Cups, Part I by acdha on Friday September 27, 2024 @07:30AM (#41669088)
That attitude was popular in the 90s but any definition of “sensibly configured” in this century involves a firewall.

The reason is that even experts make mistakes, get busy, or rely on assumptions which turn out to be incorrect. For example, you thought your service which uses strong authentication and SSH was safe to expose – and then Heartbleed or RegreSSHion happened. If you restricted ingress, you slept calmly. If you had it open, you had an emergency rush to patch and look for signs of compromise.

Re:Attacking Unix Systems via Cups, Part I by m4rtink on Friday September 27, 2024 @06:51AM (#41668733)
It is ? At least on Fedora Workstation for example, Firewall (controlled by firewalld) is installed and enabled by default.
Re:Attacking Unix Systems via Cups, Part I by yrro on Friday September 27, 2024 @11:55AM (#41672104)
Bear in mind that the default FedoraWorkstation firewalld policy does not protect TCP/UDP ports >= 1025.

Fortunately, in this case, cups-browsed uses port 631/udp :)

Re:Attacking Unix Systems via Cups, Part I by consteval on Monday September 30, 2024 @04:49PM (#41701930)
It is on Ubuntu last I checked.
Re:Attacking Unix Systems via Cups, Part I by ImpostorKeanu on Thursday September 26, 2024 @08:02PM (#41664902)
Lateral movement and privilege escalation are total wins, tho.
Re:Attacking Unix Systems via Cups, Part I by eadmund on Thursday September 26, 2024 @10:16PM (#41665646)
It sounds like in this case “exposing CUPS to the Internet” means “running a Linux desktop on the Internet” which while not something I would do doesn’t seem crazy. I would hope that a default Debian desktop installation would be secure enough to set up without a firewall.

I certainly expect that a Linux laptop shouldn’t be highly vulnerable to every other device on, say, an æroport’s WiFi.

Re:Attacking Unix Systems via Cups, Part I by rollcat on Friday September 27, 2024 @03:44PM (#41674777)
> I would hope that a default [OS] desktop installation would be secure enough to set up without a firewall.

The OS you have in mind is called OpenBSD, which has had two remote holes in the default installation in about 3 decades; and if you don't need to run Linux-only applications, it actually is a pretty decent desktop.

I don't blame Linux distributions however - both Windows and macOS are way worse. We've been living through a crisis of complexity, everyone is keen to call out Electron apps but we keep on installing and using them. As long as we accept this complexity, things will keep getting worse.