Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


CVE-2019-14287: sudo allows to run commands as root by specifying the user ID -1
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

CVE-2019-14287: sudo allows to run commands as root by specifying the user ID -1

sudo versions prior to 1.8.28 are affected.

When sudo is configured to allow a user to run commands as an arbitrary user via the ALL keyword in a Runas specification, it is possible to run commands as root by specifying the user ID -1 or 4294967295.

This can be used by a user with sufficient sudo privileges to run commands as root even if the Runas specification explicitly disallows root access as long as the ALL keyword is listed first in the Runas specification.

Ref.: https://www.sudo.ws/alerts/minus_1_uid.html

The vulnerability, tracked as CVE-2019-14287 and discovered by Joe Vennix of Apple Information Security, is more concerning because the sudo utility has been designed to let users use their own login password to execute commands as a different user without requiring their password.

The vulnerability affects all Sudo versions prior to the latest released version 1.8.28, which has been released today (10.14), a few hours ago and would soon be rolled out as an update by various Linux distributions to their users.

Ref.: https://thehackernews.com/2019/10/linux-sudo-run-as-root-flaw.html

Comments

  • Interesting that 1.8.28 didn't show up as a security update.

    Thanked by 1tgl
  • This is sooo juicy.

    Thanked by 1ITLabs
  • jarjar Patron Provider, Top Host, Veteran

    But the user has to be listed in sudoers so it's not like your average privileged user just got a free pass.

    Thanked by 1default
  • FAT32FAT32 Administrator, Deal Compiler Extraordinaire
    edited October 2019

    I believe CVE-2019-14835 is quite interesting too among recently disclosed issues

    "A buffer overflow flaw was found, in versions from 2.6.34 to 5.2.x, in the way Linux kernel's vhost functionality that translates virtqueue buffers to IOVs, logged the buffer descriptors during migration. A privileged guest user able to pass descriptors with invalid length to the host when migration is underway, could use this flaw to increase their privileges on the host."


    In other words, KVM guests are able to escalate their privileges to takeover the host.

    Thanked by 3ITLabs Janevski hanoi
  • Didn't sudoers already get root access when you run commands as sudo?

  • FAT32FAT32 Administrator, Deal Compiler Extraordinaire

    @somik said:
    Didn't sudoers already get root access when you run commands as sudo?

    Yes but you can restrict some binaries to only accessible by certain users among the sudoers

    Thanked by 2somik uptime
  • raindog308raindog308 Administrator, Veteran

    Meanwhile, OpenBSD is...

    wait for it...

    ...not vulnerable, because they threw out sudo due to other issues and replaced it with their own, more secure alternative, doas.

  • As I understand from the sudo.ws webpage:

    • Sudoers already allowed to run as root (default config?) will be able to run as root while escaping being correctly logged
    • Sudoers not allowed to run as root (requires special config) will be able to actually run as root, and escape being correctly logged
  • ITLabsITLabs Member
    edited October 2019

    @allnetstore said:
    As I understand from the sudo.ws webpage:

    • Sudoers already allowed to run as root (default config?) will be able to run as root while escaping being correctly logged
    • Sudoers not allowed to run as root (requires special config) will be able to actually run as root, and escape being correctly logged

    Yes, the flaw occurs in a very specific scenario. Sudo has to be set up to allow a user to run a specific command as "any other user except root", e.g.:

    user = (ALL, !root) /usr/bin/vi

    Edit: updates for Ubuntu released: https://usn.ubuntu.com/4154-1/

    Thanked by 2farsighter uptime
  • @raindog308 said:
    Meanwhile, OpenBSD is...

    wait for it...

    ...not vulnerable, because they threw out sudo due to other issues and replaced it with their own, more secure alternative, doas.

    Very true. Of course, doas has it's own vulnerabilities which nobody ever finds because nobody uses OpenBSD.

    Thanked by 4grep M66B maverickp hanoi
  • rm_rm_ IPv6 Advocate, Veteran
    edited October 2019

    edited: Oh I get it now, the bug is that (ALL, !root) did not work as expected.

  • jsgjsg Member, Resident Benchmarker

    Lovely. 64 bit and 32 bit signed and unsigned integers all funnily mingled and as added bonus non existing users treated as root. Great.
    Plus short "cool" identifiers used because, you know, editors can't do autocomplete and because, well because he can and is a cool unix security hackzor.
    Plus, sadly, the (ALL, !root) construct isn't that rarely found.

    Enjoy your warm "linux/unix keeps us secure" feeling while it lasts ...

    Thanked by 1ras07
  • @ITLabs said:

    Yes, the flaw occurs in a very specific scenario. Sudo has to be set up to allow a user to run a specific command as "any other user except root", e.g.:

    user = (ALL, !root) /usr/bin/vi

    Edit: updates for Ubuntu released: https://usn.ubuntu.com/4154-1/

    Ah, that is a very specific condition. I didn't even know it existed. I guess it is good when you want users to get shared ssh access with elevated permissions without giving them root permissions. Doesn't matter for those who owns their own private servers through...

  • @jsg said:
    Enjoy your warm "linux/unix keeps us secure" feeling while it lasts ...

    ^^^ This ^^^

  • @ras07 said:

    @jsg said:
    Enjoy your warm "linux/unix keeps us secure" feeling while it lasts ...

    ^^^ This ^^^

    The difference being it's patched quickly and doesn't take 40 minutes to update the OS.

  • jsgjsg Member, Resident Benchmarker
    edited October 2019

    @AlwaysSkint said:
    The difference being it's patched quickly and doesn't take 40 minutes to update the OS.

    Pardon me but what's the worth of that considering that millions and millions of sudo users were exposed to a significant vulnerability for many years?

    Let's be honest: that code has been sloppily and carelessly hacked (as opposed to being developed to good engineering standards). The sad fact is that that code would not even be accepted in a truly professional and security minded setting.

    If anyone wants a TL;DR it is "careless, ignorant, sloppy, error-prone".

  • AlwaysSkintAlwaysSkint Member
    edited October 2019

    ^ can't argue against that, though I've never seen that particular usage of sudo before.

  • I always warmed about negative numbers, they are evil and sneaky.

    By the way, when I was doing my daily servers checkup, it surprised me to see "sudo" in the list of package needing to be updated.

  • Now we only need to find SSH Key based authentication bug, so noone would need passwords to take over machines :)

  • NeoonNeoon Community Contributor, Veteran

    @MrEd said:
    Now we only need to find SSH Key based authentication bug, so noone would need passwords to take over machines :)

    Have you ever heard about Firewall?
    Its very affective.

  • Its affective, but there are so many servers with public ssh accessable...

  • @jsg said:
    Lovely. 64 bit and 32 bit signed and unsigned integers all funnily mingled and as added bonus non existing users treated as root. Great.
    Plus short "cool" identifiers used because, you know, editors can't do autocomplete and because, well because he can and is a cool unix security hackzor.
    Plus, sadly, the (ALL, !root) construct isn't that rarely found.

    Enjoy your warm "linux/unix keeps us secure" feeling while it lasts ...

    Isn't that rarely found? When and why would this be used commonly? Most users just Google for passwordless or running an application with specific permissions, I don't see everyday people stumbling into a HowTo post that people blindly copy.

  • Windows for the win!

    Thanked by 1creep
  • bountysitebountysite Member
    edited October 2019

    Previously ubuntu used to be shipped with default passwordless sudo. Escalating privileges was easy.
    Later, Debian stopped giving sudo by default.

    You still need the allowed program to do something. I know this is bad, but this is just first step.
    Whatever program is allowed in sudo, needs to be able to write or run something malicious as root, for a privilege escalation.

Sign In or Register to comment.