samlinnfer 3 hours ago

24.04 also ships with a footgun that keeps PasswordAuthentication enabled even if you edit /etc/ssh/sshd_config. It adds a /etc/ssh/sshd_config.d/50-cloud-init.conf that force overrides any PasswordAuthentication settings you have configured in /etc/ssh/sshd_config.

See here: https://news.ycombinator.com/item?id=42133181

  • homebrewer 27 minutes ago

    The proposed solution is bad, the file will be restored by the package manager at some point. Always prefix your override files with '99-' or 'zz-', this would have prevented the problem.

  • MortyWaves 2 hours ago

    Now I definitely feel glad that I decided on moving back to Debian for servers.

    • amelius 2 hours ago

      Does anyone know how to turn off auto updates on Ubuntu 22?

      I thought I fixed it, but apparently not. It is driving me crazy.

BonusPlay 6 hours ago

Linux Local Privilege Escalation, but the attacker has to be in sudo group in the first place.

Great read, but this feels like academic research. Technically correct, but impractical at best.

  • nneonneo 6 hours ago

    To be precise: you don't need to be in the sudo group, but in the lpadmin group. I'm not familiar with how Ubuntu groups are set up, but I guess it's likely that lpadmin is only granted to administrators by default.

    That said, I'm guessing people aren't expecting lpadmin to mean a full privilege escalation to root.

    There are two bugs here: one in cups, which allows it to chmod anything 777 (doesn't properly check for symlinks, or for the failure of bind), and one in wpa_supplicant, which lets it load arbitrary .so files as root. However, I suspect that even if these bugs are fixed, having access to lpadmin will still be a powerful enough primitive to escalate to root given the rather sizable attack surface of cups.

    • justmarc 5 hours ago

      It became crystal clear that cups is a can of worms, and it would be prudent to completely replace it with with a new solution built from the ground up, ideally using modern tools and standards.

      • nox101 23 minutes ago

        I'd prefer they make it the default to not install it. I don't need to print from Linux. I don't print from Windows nor MacOS much either. Less than once a year. But I particularly don't print from Linux. I suspect that true for most people. cups shouldn't be a default install IMO

      • compsciphd 4 hours ago

        or just sandbox cups. There's no reason cups needs to write anything beyond its "configuration" and its "print spool". And hence, shouldn't have access to anything beyond what it needs to configure itself and print.

        thing like cups should be easy to sandbox, especially if we allow dbus like APIs as a means to cross sandbox boundaries (i.e. RPC mechanism).

        and by sandbox, I dont mean simply use apparmor type rules (though that can work), but a cups that lives within its own file system and nothing else is even visible.

        i.e. programs will always be buggy, even if we get rid of all language oriented bugs, there will still be logic bugs that will result in security holes. We just need to make it easy to isolate programs (and services) into their own sandboxes while retaining the ability for them to interact (as otherwise, lose much of the value of modern systems).

        In practice, I would argue, a lot of modern systems do this already (ala ios/android). The apps run sandboxed and only have restricted abilities to interact with each other.

        • jabl 38 minutes ago

          That's sort-of the direction they're going with CUPS 3. The 'local server', which is what most people will need, runs as a normal user, not root, doesn't listen on the internet, and talks only the IPP everywhere protocol. For supporting legacy printers, there will be separate sandboxed 'printer applications' which read in IPP Everywhere, run the driver code, and communicate with the backend printer using an appropriate protocol.

          For enterprise users there will be a separate 'sharing server'.

          https://ftp.pwg.org/pub/pwg/liaison/openprinting/presentatio...

      • cherryteastain 5 hours ago

        And that new solution will have only 70% of cups' features 15 years in with tons of gotchas in everyday use cases, like wayland

        • pzmarzly 4 hours ago

          > new solution will have only 70% of cups' features 15 years

          Which sounds fine? Most people don't want LPT printers support, they want AirPrint and WSD to just work.

          • ale42 3 hours ago

            How many percent is "most" people? What about enterprise users with complex setups/requirements, will they be supported or out-of-luck? Typically you'll have print servers with centralized authentication, possibly logging/auditing/billing, any this might depend on "the" component they'll leave out in the new product because, well, most people don't care about it...

            • JadeNB an hour ago

              > How many percent is "most" people? What about enterprise users with complex setups/requirements, will they be supported or out-of-luck? Typically you'll have print servers with centralized authentication, possibly logging/auditing/billing, any this might depend on "the" component they'll leave out in the new product because, well, most people don't care about it...

              But the old, complex cups doesn't go away if a new, sandboxed version is developed, so the people who want the complexities can evaluate whether the security trade-off is worth it, and use it anyway if so.

      • jabl 43 minutes ago

        Well it's your lucky day, they're working on rearchitecting cups to be, among other things, more secure. See https://ftp.pwg.org/pub/pwg/liaison/openprinting/presentatio...

        • panarky 24 minutes ago

          What if you don't need cups because you don't print anything?

          Just sudo apt remove cups right?

          No, because cups is a dependency of the entire graphical subsystem, just removing cups also removes everything from the Nautilus file manager to Firefox to ubuntu-desktop itself.

      • nikanj 2 hours ago

        Using modern tools and standards? So build with node.js, runs like a pig, only supports the three models made by the sponsoring company?

      • cozzyd an hour ago

        systemd-printd incoming

  • rlpb 6 hours ago

    To expand on this: if the user is in the sudo group, they have explicit permission to execute anything they like as root. If someone wants a user to not be able to do this, they don't put that user in the sudo group. As far as I can tell from the write-up, if you remove a user from the sudo group because you don't want them to have that privilege then this "exploit" won't work.

    The bugs found look correct and have security implications, but what is demonstrated is therefore not really "root privilege escalation" since it applies only to users who already have that privilege.

    • LeifCarrotson 6 hours ago

      They can execute anything they like as root... by entering their password.

      This post shows a way that clever code can execute anything it likes as root without knowing the user's password. That seems pretty significant to me.

      • rlpb 5 hours ago

        > They can execute anything they like as root... by entering their password.

        If it has control of your user account, then it can just arrange to wrap your shell prompt and wait for you to sudo something else. The sudo password prompt in its default arrangement doesn't really provide much security there and isn't expected to.

        • withinboredom 4 hours ago

          On a server, you may be waiting months for that human to login and use sudo. Maybe even years.

          • chmod775 2 hours ago

            On a properly configured server you'll be waiting forever, because the users actually running the applications on that server aren't the same users who have privileges to make changes to the system or have access to stuff like sudo. So if you take over the nginx/postgres/whatever user, you're not really going to get anywhere.

            On the other hand you probably don't need to. Those users already expose all the juicy data on the server. You don't gain much from obtaining root anyways, except better persistence.

            This attack might be more interesting when chained with some other exploit that gains access to a users system via their e-mail client or browser. In other words nice if you're NSO Group making exploits for targeting individuals, but not that useful if you're trying to make a botnet.

          • rlpb 3 hours ago

            That's not really relevant nowadays. Most attacks are done indiscriminately and en-masse, so an attacker wouldn't have to wait very long in practice.

            Only in "advanced persistent thread" territory is your point really relevant, but the attack I describe is much more widely applicable. Having to wait a while is therefore not in any way a mitigation. In practice then, one cannot assume any security from sudo requiring a password.

            https://en.wikipedia.org/wiki/Advanced_persistent_threat

      • nneonneo 2 hours ago

        Somewhat tangentially, I will say that Touch ID-based sudo is a real upgrade over password sudo. It still gives you that extra moment to reflect on whether you really want to run that command (unlike passwordless sudo), without being burdensome.

      • akira2501 6 hours ago

        Using print server vulnerabilities to gain local privilege escalation is reminiscent of Windows 95. The year of "Linux on the Desktop," I guess.

  • dTal 3 hours ago

    If that is your attitude, why bother with the sudo group at all? Just run as root.

    (For what it's worth, I think most people would not lose much security from running as root, and the obsession with sudo is so much security theater, for exactly this sort of reason.)

    • chgs 2 hours ago

      User accounts and sudo does auditing of who is doing what. They’re are other ways, sure, but checking auth.log is the simplest.

      And while lpadmin users can escalate, I’m more interested in escalations from services like web servers or whatever, running as low priv users. I use sudo to allow scripts running as my web server to run specific limited privileged programs as a simple layer of defence.

    • nneonneo 2 hours ago

      Honestly, sudo’s value is really sanity, not security.

      The first time you use certain flavors of sudo, you get a nice little message which reminds you why sudo exists:

        We trust you have received the usual lecture from the local System
        Administrator. It usually boils down to these three things:
        
            #1) Respect the privacy of others.
            #2) Think before you type.
            #3) With great power comes great responsibility.
      
      
      Realistically, sudo exists to remind a user of these points. That is: by needing to type “sudo” before a command, you’re being reminded to pay closer attention that you’re not violating another user’s privacy or doing something that’s going to break your system.
sheerun 2 hours ago

The only feedback I get when installing d-spy is "Uses System Services", and "Uses Session Services", which means nothing to me as a user, and yet it allows program to enumerate all programs I use and as it turns out even hack my computer. Other platforms solved this with something like "developer mode", iOS, Android, Meta, etc. I shouldn't be able to install this app without confirming developer-mode-only permissions. As for this particular app it is offline, yes, but dbus allows for cross-app communication, so no more

  • nneonneo 2 hours ago

    You’re running desktop Linux - your whole system is permanently in “developer mode”. That’s kind of the point? Windows and macOS don’t have “developer mode” either, at least not to the extent seen in the mobile OSes.

    They’re very different models of computing.

schoen 2 days ago

I wonder if there's a tool to create dependency graphs for these dbus and polkit interactions, ideally to better audit those that seem to cross interesting trust boundaries.

fred_is_fred a day ago

That was a great read. The way the author builds the exploit, brick by brick, is well done and not all all obvious or clear. Each step by itself is somewhat concerning but there's no Eureka! moment until very late.