Attacking UNIX Systems via CUPS

438 pointsposted a year ago
by NetBender

210 Comments

Tiberium

a year ago

Wait, this is a joke, right?

> 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).*

(emphasis mine)

There's no way this is 9.9 when Heartbleed was just 7.5...

EDIT: Wanted to add why I think he has overblown this way too much. His original tweet stated "* Unauthenticated RCE vs all GNU/Linux systems (plus others)" but as we can see this isn't nearly the case as on a lot of distros CUPS only listens on loopback or isn't installed at all.

Another point:

> Full disclosure, I’ve been scanning the entire public internet IPv4 ranges several times a day for weeks, sending the UDP packet and logging whatever connected back. And I’ve got back connections from hundreds of thousands of devices, with peaks of 200-300K concurrent devices

If I'm understanding this correctly, he only found 300 thousand open CUPS instances in the whole public IPv4. Remember - the CUPS server needs to receive a print job in order for the RCE to happen, which I doubt most of these instances will get.

crote

a year ago

Reading through this writeup I'd argue it's indeed quite bad, but more in the sense that the entire `cups-browsed` daemon should probably stop existing, and the Linux ecosystem should have a serious discussion about the future of CUPS in general.

These bugs look surprisingly trivial, and upstream response to what is in the end still a fairly serious security issue isn't exactly what one would expect from an installed-by-default desktop Linux package.

But no, it's definitely not worth the stop-the-world CVSS 9.9 panic.

sam_lowry_

a year ago

CUPS 3 goes the other way, relying solely on IPP for discovery and autoconfiguration.

yrro

a year ago

> the entire `cups-browsed` daemon should probably stop existing

It's a legacy component that you don't need with modern printers - cups itself only support IPP Everywhere (printer discovery via mDNS) these days.

seanhunter

a year ago

To give the author full credit, they say

> Impact wise I wouldn’t classify it as a 9.9, but then again, what the hell do I know?

rini17

a year ago

There are also buffer overflows exploitable without any user action. The foomatic vector which requires print job was just one easiest to scan and exploit.

Tiberium

a year ago

Thanks, I missed that. But that still leaves us with only 300 thousand exploitable instances in the whole public IPv4 address space. This is nowhere near a universal GNU/Linux RCE. Of course it's still a big deal to those affected servers, but it's nowhere near even RegreSSHion.

tsimionescu

a year ago

No, the author said that the peak concurrent connections was 300k. That tells us there are at least that many vulnerable hosts publicly exploitable, but there could be many more that are transiently exploitable.

Also, this attack is easily triggered from any LAN, such as an airport or university or corporate or coffee shop network. And it is persistent: the attacker persistently registers a "printer" on your system (potentially overwriting a real printer that you actually have), and later when you print, even disconnected from the internet, you can trigger the RCE.

nullindividual

a year ago

That's nearly as many as Code Red and roughly 100K more than SQL Slammer.

cjbprime

a year ago

Are you sure? E.g. the blog post mentions a one-byte read overflow, which is unlikely to be directly exploitable.

rini17

a year ago

It also mentions:

> I can tell you that there’re other, more easily exploitable code paths going on, not just in the discovery mechanism - also reported and ignored. To this day they have not been acknowledged or patched.

ezekg

a year ago

> Wait, this is a joke, right?

Not gonna lie, I died laughing at the "Look at me, I'm the printer now" meme.

So in a way, it did have a good joke regardless of how you rank severity.

H8crilA

a year ago

Heartbleed is a memory leak, this is a full RCE without user action - RCE obviously implies full information leakage, and more. Specifically the execution is delayed until the next time a user uses their own printer (which config has been substituted by the attacker). And the vulnerability is in cupsd-browser, not cupsd.

The author may have some attitude problem, but this is a legit Big Deal vulnerability.

tga_d

a year ago

It's RCE (as the lp user, if I'm not mistaken) with user action, and only if the firewall isn't blocking required ports. Most systems, even most systems with CUPS installed, never print anything. The number of systems with no firewall (where "firewall" here could just be NAT) that actually print something is even smaller.

voytec

a year ago

From the last image in the article:

> 3. Command execution (cups-browsed, cups-filters): 9.9

> CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:L - CWE-94

Arch-TK

a year ago

This is strictly a miscalculation/fudge.

In isolation (which is what CVSS is all about) this is not a network exploitable vulnerability, even if you can craft an attack chain which exploits it over the network.

So:

AV:N -> AV:L - reason above

AC:L - correct

PR:N -> PR:L - to exploit this you need to get cups to process a PPD file. Ignoring how it got there, writing a PPD file requires low privileges on the local machine (unless I'm wrong and you can't add a printer to cups as a local user by default, in which case this becomes PR:H with an overall score of 7.7). These might be fulfilled by another component of the attack chain, but again, you need to strictly think in terms of the vulnerability in a vacuum.

UI:N -> UI:R - that a user must perform a task after you begin exploitation in order for the exploit to complete is a classical example of required user interaction

S:C - correct, attacking cups and getting root on the whole machine is considered a scope change

C:L -> C:H - Running arbitrary code as root on a machine is a total breach of all confidentiality of the local machine, so not sure why this was marked as low.

I:H - correct

A:L -> A:H - Running arbitrary code as root on a machine lets you do anything to completely disable it permanently. Availability impact is high.

In summary a score of 8.2 (CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H) for CVE-2024-47177 in a vacuum.

dfc

a year ago

But it seems like User Interaction is required.

tsimionescu

a year ago

Printing something at some point arbitrarily later on the system is almost certainly not classed as User Interaction in this sense.

Tiberium

a year ago

Yeah, I guess you're right, for CUPS it might be 9.9. My other added points about it being a vastly overblown exploit still stand.

Fnoord

a year ago

Apparently there are 300k people in the world who decided they need to have their printer available to the whole internet. It does not make sense, at all, but here we are. I suspect a lot of printers are going to be vulnerable with no patches in sight, but... these should only be available via LAN. Which is still an issue, but less so than it seems.

tsimionescu

a year ago

It's not that. Apparently, several major Linux distros, and the cups-browsed developers, have decided for people that any device on the internet should be able to connect to their system as a printer.

BenjiWiebe

a year ago

How do they get around the built-in firewall that's been standard on home routers for the past 15 years?

gmuslera

a year ago

Maybe some may fall into the IOT/Embedded category. Wouldn't be very surprise if i.e. a cheap wifi camera have cups installed just because and jumps out in this scan.

a96

a year ago

Or, there are a whole lot of sites running honeypots. But it's still probably a very large number.

pxc

a year ago

The I in IPP stands for 'Internet'. I guess some people really mean it.

that_guy_iain

a year ago

> There's no way this is 9.9 when Heartbleed was just 7.5...

There are tons of 10s and for, what are IMO, really silly things.

znpy

a year ago

The whole thing looks severely overstated. If i was in bad faith i'd say the guy is looking for fame.

I wonder, has the guy tried reproducing the exploit on RHEL/Fedora or some other SELinux-protected system? Because this looks like the kind of issue that SELinux would protect you from:

    1. cups likely does not have permissions to go and write executable binary files around
    2. cups likely does not have permissions to go and exec binaries without the appropriate labels
If that's the case, this would really be a testament to SELinux and the final blow to AppArmor or whatever Canonical is shipping nowadays (clearly useless).

I still think that maybe you could steal printing document, but i haven't tried. Anyway, i see there's plenty of CUPS-related selinux work documented via manpages. Example: https://www.systutorials.com/docs/linux/man/8-cupsd_selinux/

Fnoord

a year ago

Evilsocket is a known hacker. They made for example Bettercap (Pwnagotchi), Opensnitch, and a myriad of other tools. They don't need fame.

jsiepkes

a year ago

People who already have some level of fame often feel pressure to keep meeting "expectations".

mort96

a year ago

Red Hat is the company which first assigned a score of 9.9 fwiw, I think they would've mentioned if it didn't affect RHEL/Fedora?

shrubble

a year ago

The first thing many do in the real world, after installing RHEL or the free derivatives is ... turn off SELinux.

worthless-trash

a year ago

It is a great way to show which people care about security.

I equate (and I am likely not alone) that this would be a modern equivalent of chmod -R 777 / in early Unix computing.

Use of AppArmour/SElinux is probably a good filter during an interview to determine if a person is a good fit for a security conscious position.

znpy

a year ago

> The first thing many do in the real world, after installing RHEL or the free derivatives is ... turn off SELinux.

The people with port 631 publicly reachable didn't configure their firewall either (neither at OS level nor at infrastructure level) so what now, firewalls are useless?

yrro

a year ago

If you want to get fired, sure!

anthk

a year ago

Cups needs permissions for Foomatic and some printing filters.

user

a year ago

[deleted]

dumpsterdiver

a year ago

Are you suggesting that people should not report remote command execution vulnerabilities when such vulnerabilities are successfully stopped by SELinux?

Also, why do you think that seeking recognition for your efforts a bad thing?

znpy

a year ago

> Are you suggesting that people should not report remote command execution vulnerabilities when such vulnerabilities are successfully stopped by SELinux?

No, I'm suggesting that only testing on system shipping weak protection systems and poor defaults is misleading.

> Also, why do you think that seeking recognition for your efforts a bad thing?

It isn't by default, but it can become a bad thing when you overstate the importance of your finding: see my previous line in this comment and add the fact that this guy picked a cve score of 9.9 where heartbleed had "only" a 7.5 score -- but heartbleed affected pretty much everybody in the industry.

Arch-TK

a year ago

CVSS scores are meaningless in a vacuum, and in this case it seems the redhat person who calculated them took the "fudge it until it looks bad" approach.

Below is my professional scoring evaluation while trying to keep to the ideas behind CVSS and the spec as much as I can. Although CVSS is used so rarely in my work (as it usually inappropriate) that I may have made some miscalculations.

CVE-2024-47176 5.3 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

CVE-2024-47046 4.3 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N

CVE-2024-47175 3.3 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N

CVE-2024-47177 8.2 CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

If I apply the same exact approach to scoring Heartbleed I get:

7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

The key differences between Heartbleed and the final code execution issue in the attack chain are that Heartbleed is directly over the network (in a vacuum) whereas the code execution is entirely local (in a vacuum, ignoring the previous elements of the attack chain, assuming they were themselves fixed). Additionally with heartbleed there is no user interaction required which also raises the score. But conversely, the direct impact of heartbleed (ignoring what you can do with the information) is that it is only a confidentiality impact (although you could argue that it can lead to a crash which would be a low availability impact bringing the score up to 8.2).

I don't think this clarifies much about the scores but hopefully you can see why CVSS scores are meaningless without any context. You need to put them in the context of the environment. The other problem is that in an attack chain, the overall outcome might be bad even if all the individual issues score low. But CVSS doesn't apply to attack chains.

At the end of the day, this is a high risk issue (you say many distros have cups listen on loopback, but I think this is not true, 631 tcp is indeed loopback only, but 631 tcp is in fact commonly bound to 0.0.0.0) but only in the context of your laptop which you happen to connect to untrusted networks without a firewall.

In summary:

This problem as a whole primarily affects desktop systems and some servers.

Device running cups exposed to the internet: Critical

Device running cups connected to untrusted (but local/non internet routable) networks: High

Device running cups connected to trusted networks: Medium

RGBCube

a year ago

Anyone exposing CUPS to the internet is living a level of not giving a fuck that CVEs cannot reach.

DanMcInerney

a year ago

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. Granted, requires user to print something to trigger which, I mean, I don't think I've printed anything from Linux in my life, but he does claim getting callbacks from 100's of thousands of linux machines which is believable.

btown

a year ago

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!

runjake

a year ago

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.

gordonfish

a year ago

This is why on public servers I block everything inbound and only allow specific needed services through.

bongodongobob

a year ago

Who doesn't block all unneeded ports on an internet facing server or have it behind a firewall of some sort?

bshipp

a year ago

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.

eikenberry

a year ago

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. ]

mikepavone

a year ago

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

bonzini

a year ago

OpenSUSE

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

cp9

a year ago

on popOS I see 0.0.0.0:*

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

RGBCube

a year ago

I'm pretty sure all major distros configure it to listen locally instead.

mikepavone

a year ago

cupsd is configured to listen locally, but cups-browsed has to listen on the network to do its job (network printer auto-discovery)

eadmund

a year ago

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.

rollcat

a year ago

> 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.

johnklos

a year ago

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.

gordonfish

a year ago

Honestly, this is why firewalls exist. This really isn't problem for anyone with basic computer hygiene.

zanecodes

a year ago

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.

abhinavk

a year ago

Why isn't the firewall on by default on desktop systems?

amluto

a year ago

And, for some utterly and completely absurd reason, CUPS runs as a system daemon instead of a highly sandboxed user program.

edelbitter

a year ago

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.

jmclnx

a year ago

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.

throwanem

a year ago

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.

aftbit

a year ago

Why does it need to run as `root` user and not `cups`?

amluto

a year ago

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.

bshipp

a year ago

This is the worry. It seems like a really unnecessary privilege escalation.

jeffbee

a year ago

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.

ImpostorKeanu

a year ago

Lateral movement and privilege escalation are total wins, tho.

RGBCube

a year ago

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.

NavinF

a year ago

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

DanMcInerney

a year ago

Depending on your interpretation of the Scope metric in CVSSv3, this is either an 8.8 or a 9.6 CVSS to be more accurate.

In summary, there's a service (CUPS) that is exposed to the LAN (0.0.0.0) on at least some desktop flavors of Linux and runs as root that is vulnerable to unauth RCE. CUPS is not a default service on most of the server-oriented linux machines like Ubuntu Server or CentOS, but does appear to start by default on most desktop flavors of linux. To trigger the RCE the user on the vulnerable linux machine must print a document after being exploited.

Evilsocket claims to have had 100's of thousands of callbacks showing that despite the fact most of us have probably never printed anything from Linux, the impact is enough to create a large botnet regardless.

funcDropShadow

a year ago

Universities are full of people with Linux desktops with public IPs and that are printing all the time: papers, their own and other's.

znpy

a year ago

Having a public ip address doesn't always mean there's no firewall in between a pc and the public internet, ideally with sensible default rules. It's not 1996.

And sorry if I'm being a bit harsh on this, but this point comes up every time when ipv6 is mentioned, by people that clearly don't understand the above point.

DanMcInerney

a year ago

Yes, good point, university networks are particularly vulnerable.

guenthert

a year ago

Uh, Linux desktops have a marketshare of some 4.5% (excluding ChromeOS which isn't affected). Even if most of us don't print (I haven't in the last year and little in the previous five), that will still be a lot of print jobs emitted by Linux hosts.

mort96

a year ago

How can this be a 9.6 when heartbleed was a 7.5, how can it be just 0.4 below the xz thing

Ekaros

a year ago

Because scores are kinda bullshit.

But real answer is well if you have arbitrary remote code execution you can also read memory, where as heartbleed only read memory... And the reality is same, you were safe from heartbleed if you did not use openssl, you are safe from this if you do not use cups. CVSS score does not take into account if the software is used or not.

user

a year ago

[deleted]

jesprenj

a year ago

I panicked a little when I heard the news as I run a cupsd open on the Internet. But as it turns out, the issue is misrepresented in headlines, just like here. This is not an issue in the core cupsd, but in a separate package/component, called cups-browsed. My distribution of choice for servers, Gentoo Linux, ships cups-browsed in a separate package which I had not installed, meaning I, as well as most other cups users that did not install this additional package, am not affected by this bug.

Saying that all systems running cups can be hacked is a misrepresentation of the scale of the issue.

iforgotpassword

a year ago

I've always disliked how on Debian, usually being rather conservative, cups-browsed gets pulled in by default if you install cups. I think "no install recommends" fixes that, but iirc some add-ons like that hplip driver pull it in again. In my home setup I just disabled the service, but it's rather annoying how more and more software spirals out of scope and makes components that could be optional a requirement. Very related is avahi-daemon. Take a desktop Debian/Ubuntu and try to uninstall it; there's a good chance it's going to remove a couple other software where you wonder why avahi would be a hard dependency.

ruuda

a year ago

> That a lot is expected and taken for granted from the security researchers by triagers that behave like you have to “prove to be worth listening to” while in reality they barely care to process and understand what you are saying

The unfortunate reality is that for every well-researched report like this one, you get 57 low-effort spam reports that hope to extract a bug bounty reward, or get a CVE discovery listed on their resume. Especially with the rise of LLMs that kind of spam can easily trick you. It's a sad situation, but I don't entirely blame developers for being skeptic.

marcodiego

a year ago

Resuming:

  1 - cups-browsed is able to install printers automatically (without the requirement of user confirmation) by listening to UDP packets on port 631.
  2 - Attacker uses this "feature" to install a fake printer with a custom driver (which is also installed without user confirmation and can be downloaded from an arbitrary host) which specifies the "command to run" when a print job is sent.
  3 - User prints something in the fake printer and the "command to run" is executed.

hypeatei

a year ago

> without the requirement of user confirmation

I suppose CUPS was introduced in 1999 so it probably made sense then. But why is it still a thing today?

znpy

a year ago

I would rather expect this kind of change came later, when there has been a huge push to make the "linux desktop" more user-friendly.

1999 sounds like the time when people were a bit more expected to mess with config file and somehow always had a root terminal around. If anything, keep in mind that in 1999 it was still a rite of passage to have to learn how to write the X11 configuration file (what used to be xorg.conf)

cvhc

a year ago

While in this case distros include cups-browsed maybe as a feature, I always feel it's a bad thing Ubuntu/Debian (and maybe all deb-based distros?) automatically bring up almost all services upon installation. This means you can install a package and accidentially open another network service that's installed as a dependency.

You probably already know exim4 (to be fair it listens to only localhost by default, so maybe not a big deal). I just tried to install cups-browsed on one of my Debian machine, and it brought up two services that listens to 0.0.0.0 (cups-browsed and avahi).

This is not the case for Arch/Gentoo and CentOS-like distros.

dfc

a year ago

The original CVSS score on Twitter indicated that user interaction was not required. However reading the RCE chain on the page says:

Wait for a print job to be sent to our fake printer for the PPD directives, and therefore the command, to be executed.

If Alice never hits print it seems like a print job will never be triggered. Am I missing something? I'm not questioning evilsocket, I'm trying to check my understanding.

rini17

a year ago

There are also buffer overflows which they detected with fuzzer, which can be turned into RCE without requiring user interaction. But author did not have enough expertise in this area to create actual exploit for these.

cjbprime

a year ago

It is untrue that every buffer overflow can be exploited. We won't know whether these can be until someone tries.

playingalong

a year ago

It depends on the definition of "interaction". AFAIU Alice doesn't need to print anything supplied by the attacker. It's enough if she prints anything.

dfc

a year ago

I agree that Alice just needs to print anything but that seems like user interaction required. Its also not clear if Alice has multiple printers defined does it matter which printer she selects?

kccqzy

a year ago

She needs to print something using the fake printer. Nothing happens, IIUC, if Alice chooses to print a document with a real printer.

bborud

a year ago

Every time I need to print something on MacOS I am reminded of how much I hate printers and any printer related software. I've been messing around with computers for 40 years now and goddamnit, every decade printers become more of a pain in the neck.

Joker_vD

a year ago

Funny how the whole FSF movement started in no small part because Stallman was irritated with the low quality of printer drivers... and how that movement for some (?) reason failed, in 40 years, to noticeably improve the quality of printer-related software.

playingalong

a year ago

But at least we got all the byproducts.

linuxlizard

a year ago

I wrote printer code for 10+ years. I appreciate how hard the technical problems are but vendors make it so much worse. I loathe printers. Printers peaked with the LaserJet III.

sliken

a year ago

Agreed, I ran several busy printers for a large department. The ljet IIIs were work houses and ran nearly forever if you used the recommended part replacement schedule.

We had a ljet III that outlasted ljet 4, ljet 5, and ljet 4000. Ljet 3 was the last with the HP print engine, afterwards they used Canon print engines.

The network interface was brittle, even a nmap would hang the printer. So we firewalled it off and used CUPS to handle postscript -> PCL. Sending only PCL to the printer (postscript memory and CPU is unbounded) made them faster and MUCH more reliable.

gruturo

a year ago

IIRC the Laserjet 4 had a much better warm-up time (and lower power consumption) by switching to a thin ceramic heating element rather than heating half the printer. But yeah anything after that is downhill.

bborud

a year ago

It would be helpful to understand exactly which layers in the stack you think of as technically difficult.

niwtsol

a year ago

do you mind lightly summarizing what technical problems make it more difficult? I'm assuming there are all sorts of things web-devs never even think about from that world.

op00to

a year ago

I feel like printers are far better now than they were 10 years ago. At least on MacOS and iOS, I have no problems finding a printer and printing. 10 years ago it was a pain, but now - smooth sailing for me. Heck, no driver installs either!

bborud

a year ago

Well, apart from printers added throug Bonjour constantly going missing and have to be re-added regularly, and (HP) printer drivers suddenly no longer working and being flagged as malware after OS upgrades.

Setting up an old RPi with CUPS helped a bit. For a while. Now I'm back to having to re-add printers to my mac workstation every time I want to print.

cp9

a year ago

printing even works on linux now, thanks to stuff like Airprint and the support for it in CUPS

pushupentry1219

a year ago

You lose job control, but I've just done a netcat to a port on my printer with my document converted to PostScript and it works fine

pdf2ps <doc> - | nc <printer> 9001

arp242

a year ago

I used to have a dot-matrix printer from the 80s. I could print with "cat file.txt >/dev/lpt0". It was amazing.

Didn't do Unicode unfortunately, and monospace only, and no bold and stuff like that.

But still the best printer I've ever owned.

cryptonector

a year ago

Do you remember those portable sh-coded HP JetAdmin printer drivers? Are you saying things today are worse than that?

sliken

a year ago

Heh, I've heard complaints about multi GB driver installs on windows, sounds worse to me.

spookie

a year ago

Of course its CUPS.

Saying it affects all "Linux" systems is just wild.

Imagine even having that thing on your system to begin with.

Jach

a year ago

I can't imagine it on a normal server expected to serve public internet requests. The way you phrased that though makes me wonder for desktop use, is there a non-cups alternative to printing on linux these days that's gone under my radar? (Please don't say there's a systemd-print...) If nothing else, probably another overdue candidate for the energetic rewrite-it-in-Rust people.

wannacboatmovie

a year ago

> Imagine even having that thing on your system to begin with

Well it is the Common UNIX printing system...

If it was the Not-oft-used Printing System I could understand.

spookie

a year ago

Fair, I just don't print usually. Didn't think the phrase through too much. Sorry about that.

I've talked about alternatives in another reply, they do not offer the same flexibility as CUPS however.

EasyMark

a year ago

What’s wrong with having CUPS on your system if you actually use a printer? I’m kind of lost as the source of the “imagine”?

pxc

a year ago

That commenter is probably just someone who has never used anything but Windows on the desktop.

doubled112

a year ago

I'm certainly not regretting disabling avahi and cups-browsed on all of my systems long ago.

Do people have printers that move around all the time?

Also, firewalls on desktops and laptops for the win, yet again.

robinsonb5

a year ago

> Do people have printers that move around all the time?

I suspect it's not the printers that are moving, but the laptops.

sprayk

a year ago

> I had no idea Linux just added anything found on a network before the user can even accept or be notified. The more you know!

Windows does this too, I believe. At least it did it with a Xerox laser printer I bought and the Brother printer at my friend's place.

tsimionescu

a year ago

Windows does have a significant mitigation: whenever you connect to a new network, such as a coffee shop Wi-Fi, it defaults to considering this network Public (untrusted) and firewalls any such services from accessing it/being accessed from it. You have to explicitly set it as a "Private" network for file sharing and printer discovery and similar to work.

peanut-walrus

a year ago

Tried it out, looks like at least on Debian the filter gets invoked with limited user privileges, so not world-ending, but still bad. And it does require user interaction, but my gut feeling is that this can be bypassed with some cleverness.

However, this is only for this particular exploit. The behaviour where cups-browsed automatically downloads and installs printers from random untrusted places on the internet is insane, especially as it does it for all printers it discovers on the local network by default. At minimum anyone on a LAN can cause a DoS type attack against all Linux workstations on the same LAN by just advertising a few million printers via zeroconf.

farhanhubble

a year ago

Irrespective of the severity assigned it's a good and simple case study for any programmer, engineer or not, building drivers and low-level stuff or not. Alongside it, and the iconic "Smashing the Stack for Fun and Profit", reading "The Bugs We Need to Kill"[1], makes a programmer much more aware that every program is prone to manipulation via its inputs.

[1]: https://www.usenix.org/system/files/login/articles/login_aug...

ruthmarx

a year ago

This is a ridiculously over hyped vulnerability, the most over-hyped I've seen in a long time.

Still, kudos to the author who found it, it's going to definitely be a career boost with all the world is ending headlines.

tsimionescu

a year ago

It's probably somewhat overhyped, but it's still a really really bad vulnerability for virtually all Linux desktops, even as presented. It's a persistent compromise of your printing system that can happen to your default Linux installation by just connecting to the same wifi/LAN as an attacker, and triggered at any point later when you print something.

And it's very likely that someone will find a way to exploit it with a buffer overflow without even having to wait for the user to print something.

dottedmag

a year ago

Will it? The author goes to my «do not hire / hype-eater» list for sure.

ruthmarx

a year ago

The author isn't really the one over-hyping it.

b112

a year ago

Same here. I don't need people overstating issues working for me. I'd never be able to trust anything this person says, in terms of priority.

Literally making things up, screaming his head off, crying wolf, "all linux systems" my ass. A horrible person.

You know some people actually take security seriously? Not this guy. It's all a personal hype vector.

whywhywhywhy

a year ago

From DEFCON 1 to “it’s absolutely nothing” in 5 hours

user

a year ago

[deleted]

ugjka

a year ago

yeah i thought it was going to be something in tcp stack

scblock

a year ago

This is a lot less "exciting" than the LOOK AT ME MOM I MADE AN EXPLOIT social media posts implied.

thinkingemote

a year ago

Possibly because the devs reduced the numbers he says: "because the devs just can't accept that their code is crap - responsible disclosure: no more"

Always kind of worrying to see vulnerability researchers justifying bad behaviour because they find a vulnerability in code. Maybe it was because his pride was hurt that he threw away any ethical behaviour?

Sohcahtoa82

a year ago

> vulnerability researchers justifying bad behaviour because they find a vulnerability in code

This is an extremely bad faith take that makes me irrationally angry to read.

He's not using bad code as a reason to engage in bad behavior, he's using bad responses to responsible disclosure. Read the section under "Personal Considerations". It only took him two days to find the problem, but 22 days to get developers to admit there's a vulnerability, even when shown PoCs.

Imagine finding a vulnerability, responsibly disclosing it, being told "meh, not an issue", responding with a PoC showing full code execution, and still being told "meh, not an issue".

tsimionescu

a year ago

Maybe less exciting, but still terrible for almost anyone running a Linux desktop/laptop, especially those that expect it's safer than a Windows desktop. And it's a really bad look both for the developers of CUPS, and for most Linux distros, including RHEL, that just enabled this printer discovery backdoor by default without any mitigations in place.

gquere

a year ago

On RHEL it's installed but it's not enabled by default.

computer23

a year ago

Is there a recommended (best practice) way to nmap scan your network for vulnerable machines, just to be safe?

From Red Hat's statement: > Red Hat rates these issues with a severity impact of Important. While all versions of RHEL are affected, it is important to note that affected packages are not vulnerable in their default configuration.

Basically, Red Hat machines aren't vulnerable unless "the cups-browsed service has manually been enabled or started."

https://www.redhat.com/en/blog/red-hat-response-openprinting...

nobody9999

a year ago

>Is there a recommended (best practice) way to nmap scan your network for vulnerable machines, just to be safe?

Perhaps something like this?

   nmap -sU -p 631 -P0 [network]/[mask]

Edit: Added [network]/[mask] for completeness.

moyix

a year ago

nmap can't really tell the difference between an open or a firewalled UDP port. For this specific vuln you can send it a packet like:

echo "0 3 http://myserver:PORT/printers/foo" | nc -u target 631

And if the target is running CUPS on that port it will reach out to `myserver:PORT` and POST some data. The downside is you need to have a server running that can accept inbound requests to see if it connects back.

pushupentry1219

a year ago

Corporate organisations make use of platforms like Nessus/Tenable to provide this continuous vuln scanning for compliance reasons.

Under the hood its basically running an nmap scan and spitting out a PDF report.

LZ2DMV

a year ago

Everyone, please go to your respective data centers, locate your rack and unplug the printer from the server.

eadmund

a year ago

Not every Linux machine is a server!

This is kind of a big deal for desktop and even more so for laptop users.

LZ2DMV

a year ago

And the percentage of Linux desktops and laptops 1) with printers connected to them 2) directly exposed to the internet, is...?

nottorp

a year ago

> After some googling I found out that cups-browsed is indeed part of the CUPS system and it is responsible for discovering new printers and automatically adding them to the system. Very interesting, I had no idea Linux just added anything found on a network before the user can even accept or be notified. The more you know!

I don't know, last time i bought a new printer i plugged it into my LAN and my Apple machines automatically showed it to me and I could print to it.

Why blame Linux?

smokel

a year ago

This vulnerability seems to be pretty hard to actually exploit, but for those of you who are running Ubuntu on their desktops, consider enabling a firewall, which is as easy as:

  sudo ufw enable
Beats me why this is not the default.

tsimionescu

a year ago

Just enabling the firewall is not enough. The Ubuntu distros explicitly wanted to allow the vector for this vulnerability: the whole purpose of having cups-browsed installed is to allow LAN printers to advertise themselves to your system.

hypeatei

a year ago

Also this:

  > sudo ufw deny 631
  > sudo ufw reload

remram

a year ago

reload is unnecessary if you make changes via the command line.

usr1106

a year ago

   deny 631
is not needed. The default is deny as soon as the firewall is enabled. Tested on Ubuntu 22.04.

nirui

a year ago

Maybe the report was overblown, but I found it amusing that CUPS related facilities is shipped and activated by default in a lot of Linux distros (including Gnome Fedora in my case). I've never printed anything on this computer and yet there is this `cupsd` process running as root and listening TCP port 631 on local interface.

OK, sure, the program itself maybe safe (enough to run with root while listening a local port that everybody uses this computer can access), but is it really THAT evil if you don't run it 24/7 and instead only enable it when the user is actively using it?

jonjojojon

a year ago

I am slightly confused. If I am using a linux laptop with cups do I need to do anything besides update? Is there a sane way to print from the linux desktop. I unfortunately need to regularly print, and often from public wifi.

LinuxBender

a year ago

Unless you are exposing CUPS to other people on purpose so that you act as a print server then block inbound access using a local firewall. Your local print jobs should be able to use the loopback just fine. Your print spooler would then be talking to the IP on your printer and that should also be confined to your local network and may have optional features to further secure access.

On a very loosely related note, some enterprise printers have optional features to lock down remote access to people that are authenticated. Authentication capabilities vary by vendor. This is somewhat unrelated to CUPS but probably a good time for people to research what their printers can do as printers are a great way to steal company secrets.

[Edit] What smokel said. They beat me to it before I refreshed the page.

tsimionescu

a year ago

This is a misunderstanding of the vulnerability. The problem isn't with the print server. It is with the printer discovery mechanism, cups-browsed. That is the service that listens on the entire network, because it's designed so that LAN printers can advertise themselves to your system.

tsimionescu

a year ago

Unless you need printer discovery, you should probably shut down and remove cups-browsed entirely. Its whole purpose is to listen on the LAN to discover printers (or attackers) that advertise themselves to it.

smokel

a year ago

Not an expert, but I guess that simply enabling the firewall should avoid most problems related to this vulnerability. In Ubuntu, this can be accomplished with:

  sudo ufw enable

jonjojojon

a year ago

Thank you. I was also able to check that 631 is blocked by searching for it in output of sudo ufw show raw.

user

a year ago

[deleted]

user

a year ago

[deleted]

blueflow

a year ago

There used to be a timeframe (before like 2020) where you could use network printers without any extra software: Open your Document in Firefox, print to postscript, and then netcat that postscript to your network printer port 9100. This is the "AppSocket" protocol.

Unfortunately, Firefox removed that feature, and port 9100 is now clobbered by the Prometheus node exporter. If you accidentally add a AppSocket capable printer to Prometheus it will print out HTTP headers every other minute.

The good times are over, but on the other side, having to print something has gotten quite rare.

akvadrako

a year ago

Now we have something better, IPP everywhere. The protocol isn't as simple as netcating a postscript, but is simple enough, standardized and does everything expected for printing.

blueflow

a year ago

Is there a implementation for Linux that isn't cups?

user

a year ago

[deleted]

hacker_homie

a year ago

I though this was going to be NetworkManager the way they were hyping it up.

nullc

a year ago

> That a lot is expected and taken for granted from the security researchers by triagers that behave like you have to “prove to be worth listening to” while in reality they barely care to process and understand what you are saying, only to realize you were right all along three weeks later (if at all).

Unfortunately there is a torrent of bullshit artists claiming bullshit vulnerabilities in software. Much of it is pure nonsense such as hallucinating AI's describing imaginary bugs in imaginary code and much of what little is real is extremely overhyped-- stuff like "DOS attack where the victim has to keep clicking on the attacker's button" or, more charitably "DOS attack which is strictly less impactful than a ping flood".

ajdude

a year ago

Do networked printers themselves run CUPS? E.g. a Brother or HP laserjet plugged into a LAN.

stop50

a year ago

The last time i checked: no

They run their own software, not cups. the one i had was using their own software, if they had used cups it would have much less problems with printing.

aidenn0

a year ago

vulnerabilities are (mostly?) in cups-browserd rather than cups.

chrononaut

a year ago

Queue everyone going to Shodan and investigating how many systems have port 631 on UDP open..

beginnings

a year ago

my grandparents who are still printing things like its the 90s might be at risk, if they have installed CUPS that is

has the president been briefed yet?

shirro

a year ago

I checked 5 linux desktop/laptops here and none of them had cups-browsed or port 631 exposed. They are all able to print to a network printer. The vulnerability is real though perhaps the impact is exaggerated. Distros that tend towards installing a minimal selection of packages and services are less exposed.

cp9

a year ago

we should fix this, CUPS is used in a bunch of consumer hardware

it's not a complete disaster like it was implied to be though

0x_rs

a year ago

I don't believe this warranted all the fearmongering even if the intention was to get more attention to it and a faster resolution process, it's not far from cry wolf. Initial CVE scores are very arbitrary. CUPS is a well-known liability when exposed to unsafe networks. CVSS scores seem far from perfect. The WebP zero-day, a zero-click vulnerability that was being exploited in the wild and affecting nearly every user device made in the past decade, most of which will never be properly patched from it, received an initial 10.0, and decreased to a meager 8.8 (CVSS:3.1, and would be higher using 4.0).

cjbprime

a year ago

Why are distros allowing CUPS to listen on all interfaces, then?

tsimionescu

a year ago

The problem isn't CUPS itself, which is not made to listen on all interfaces by default. The problem is the printer discovery service, cups-browsed, which listens for any printer on the LAN (or any attacker anywhere) that advertises itself to it and automatically registers that printer in your system.

Whether it's a good idea to have a service like this is highly debatable, but if it is added, it has to listen to all requests from anywhere (and the firewall port for it has to be open), otherwise it's entirely useless.

stop50

a year ago

many distros change this to unix sockets or 127.0.0.1

user

a year ago

[deleted]

udev4096

a year ago

A basic firewall configuration could easily prevent this even if you are running the vulnerable version

tsimionescu

a year ago

Sure, but that is equivalent to removing the vulnerable service entirely and the features it was offering. Listening on port 631 for connections from any machine is the entire purpose of cups-browsed, it's the only way to do automatic printer discovery. If we think the port should be closed, then Ubuntu and the other distros should also remove this service, at least from the default installations.

EasyMark

a year ago

Yep SOP is to block all ports that I haven’t personally white listed on all my systems.

user

a year ago

[deleted]

user

a year ago

[deleted]

guluarte

a year ago

This is nowhere near as severe as the Heartbleed bug.

fizlebit

a year ago

It is bad if you print from a Linux laptop that uses WiFi isn’t it?

LZ2DMV

a year ago

Only if the machine is directly connected to the internet and the malicious packet doesn't hit a firewall somewhere along the path.

Most laptops connected to Wi-Fi are indeed connected to an AP or a SOHO router that does NAT, so the attacker won't be able to directly reach it and this is a requirement for this to work.

WhyNotHugo

a year ago

Plenty of laptops have a built in modem and this is becoming more ckmmoj every day. Those connect directly to the internet.

NAT only makes a difference if you use. IPv4 only. If you have dual stack, then your host is on the public internet.

bogwog

a year ago

I remember there was some like viral marketing thing some company did a while back where they had a website where they had a webcam pointed at a printer, and anything printed would go on a conveyer belt and fall into a literal dumpster fire. Users could submit stuff on their website and see it printed and burned live.

...anyways, maybe they were vulnerable to this attack at the time?

tsimionescu

a year ago

The attack is about a malicious printer registering itself to your system, not about a malicious system sending print jobs to a real printer.

pushupentry1219

a year ago

Then again, their printer was probably locally-networked and the documents would come in from the webserver and then be passed to the printer.

Dachande663

a year ago

I suppose the real question now is: did the author give it a 9.9 out of ignorance or malice/ego?

rini17

a year ago

RedHat did, as per the article

pabs3

a year ago

Is printing obsolete yet?

neuroelectron

a year ago

Everybody saying this is nothing burger is absolutely wrong. This is not overhyped. A lot of comments like, well my distro doesn't do this, and well yeah nobody uses printers anymore. A print server is design to be exposed. Office networks will use one and they have important data. You would think there would be some kind of hardening.

Honestly, this looks intentional.

develatio

a year ago

I'm gonna give this a 10/10 meh. Not up to all the hype that was created around it.

user

a year ago

[deleted]

andersa

a year ago

So just to make sure I understand correctly, this is a nothingburger, right? No important server has a printer attached. Any basic firewall would block this traffic.

rolph

a year ago

botnetting is about exploiting unimportant desktops, to create very important servers.

shirro

a year ago

It is irrelevant for many desktop Linux users but some distros will have installed the vulnerable software by default on desktop installations and exposed it to the network. That could make it relevant for some percentage of the small percent of people who use desktop Linux and haven't applied security updates and have network misconfiguration or other vulnerabilities exposing their machines. On a scale from 0 to Crowdstrike it is basically a 0 in terms of real impact. It is still great example of an astonishingly stupid by design vulnerability that should not exist or have survived review.

bshipp

a year ago

I don't know if I would say it's a nothing burger, but i don't see how it affects important servers. It might impact a number of linux desktops and, if they are linked to important servers, provide a backdoor access into important services.

Being able to run arbitrary code in a root account with no authentication would seem to be a pretty important security breach, although I don't think it's quite the level of danger it was built up to be.

andersa

a year ago

But why would such desktops be exposed to the public internet directly?

consteval

a year ago

1. You don't need a printer attached, you just need cups-browserd running

2. Probably your firewall, if configured, will block it. But that doesn't stop LAN requests, which can be a big deal for huge networks.

user

a year ago

[deleted]