The CUPS explout is here: GitHub - RickdeJager/cupshax (github.com)
from possiblylinux127@lemmy.zip to linux@lemmy.ml on 29 Sep 2024 04:04
https://lemmy.zip/post/23601247

I hope this goes without saying but please do not run this on machines you don’t own.

The good news:

The bad news:

TLDR: you should be careful hitting print

#linux

threaded - newest

penquin@lemm.ee on 29 Sep 2024 12:56 next collapse

Man, this is such a silly and unfortunate exploit. Damn! I hope it gets patched quick.

pHr34kY@lemmy.world on 29 Sep 2024 13:27 next collapse

CUPS facing the public internet sounds a bit crazy. Why would you print when not physicly near the printer?

subtext@lemmy.world on 29 Sep 2024 15:24 collapse

I think this would likely be most troublesome on some of the OG internet users that got a whole freaking /8, /10, or /12 or something like AT&T or universities. Up until very recently, and possibly even to the present, these organizations had such large IPv4 space, that there was no need to do NAT, and each device had a publicly addressable IP.

en.wikipedia.org/wiki/…/8_IPv4_address_blocks

possiblylinux127@lemmy.zip on 29 Sep 2024 16:36 collapse

Everything would still be behind a firewall though

jake_jake_jake_@lemmy.world on 29 Sep 2024 18:36 collapse

everything should be behind a firewall

helenslunch@feddit.nl on 29 Sep 2024 15:21 next collapse

Can I just disable CUPS?

Tyoda@lemm.ee on 29 Sep 2024 16:20 collapse

Any self-respecting distro pushed an update to fix this days ago, so just updating (and restarting cups) will do. But if you don’t print anyway, you might as well disable it.

possiblylinux127@lemmy.zip on 29 Sep 2024 16:35 collapse

There is currently no fix available

Edit: I’m mistaken

IrritableOcelot@beehaw.org on 29 Sep 2024 16:38 next collapse

I mean both Red Hat and Ubuntu did ship updates to change the config of cups-browsed, so I don’t think that’s correct.

possiblylinux127@lemmy.zip on 29 Sep 2024 17:21 collapse

Maybe my information is out of date then

superkret@feddit.org on 29 Sep 2024 16:40 next collapse

What? I got a patch on Arch yesterday.

forbiddenlake@lemmy.world on 30 Sep 2024 02:52 collapse

Not true, Arch and Ubuntu (the ones I personally checked on) already pushed patches that disabled cups browsed by default, removing the service listening on 631.

tetris11@lemmy.ml on 29 Sep 2024 17:28 collapse

The questionable commit:

    {
      // Add the first line of localized text...
      cupsFilePrintf(fp, "*%s.%s %s/", lang->language, ppd_option, ppd_choice);
      while (*text && *text != '\n')
      {
        // Escape ":" and "<"...
        if (*text == ':' || *text == '<')
          cupsFilePrintf(fp, "<%02X>", *text);
        else
          cupsFilePutChar(fp, *text);
        text ++;
      }
      cupsFilePuts(fp, ": \"\"\n");
    }

Can someone explain to me how this allows arbitrary code execution? As far as I can see, all it does iterate through a string and markup some special characters.

Edit: Okay, after reading the blog post, and this fantastic bug report, it sounds like to print to a CUPS server, you send it a message on port 631 using an IPP (some print protocol) server. CUPS then requests attributes of the IPP server, one of which being the print filter command to run (“Foomatic-rip”) to use to convert a PS or PDF into native print code. By requesting attributes, an exploit involving string escaping through the use of unexpected spaces or quotes can override the Foomatic print command. Arbitrary text can be supplanted, which will then be executed by the CUPS server.

somtwo@lemmy.world on 29 Sep 2024 17:41 next collapse

From what I understand, this allows arbitrary command execution. So, an attacker can specify a string of text that something on the affected system will just plop into a command line and execute.

possiblylinux127@lemmy.zip on 29 Sep 2024 18:55 collapse

Take a look at the exploit code