Stories
Slash Boxes
Comments

SoylentNews is people

posted by Fnord666 on Monday July 03 2017, @10:12PM   Printer-friendly
from the it's-a-feature dept.

Submitted via IRC for TheMightyBuzzard

A bug in Linux's systemd init system causes root permissions to be given to services associated with invalid usernames, and while this could pose a security risk, exploitation is not an easy task.

A developer who uses the online moniker "mapleray" last week discovered a problem related to systemd unit files, the configuration files used to describe resources and their behavior. Mapleray noticed that a systemd unit file containing an invalid username – one that starts with a digit (e.g. "0day") – will initiate the targeted process with root privileges instead of regular user privileges.

Systemd is designed not to allow usernames that start with a numeric character, but Red Hat, CentOS and other Linux distributions do allow such usernames.

"It's systemd's parsing of the User= parameter that determines the naming doesn't follow a set of conventions, and decides to fall back to its default value, root," explained developer Mattias Geniar.

While this sounds like it could be leveraged to obtain root privileges on any Linux installation using systemd, exploiting the bug in an attack is not an easy task. Geniar pointed out that the attacker needs root privileges in the first place to edit the systemd unit file and use it.

[...] Systemd developers have classified this issue as "not-a-bug" and they apparently don't plan on fixing it. Linux users are divided on the matter – some believe this is a vulnerability that could pose a serious security risk, while others agree that a fix is not necessary.

See, this is why we can't have nice init systems.

Source: http://www.securityweek.com/linux-systemd-gives-root-privileges-invalid-usernames


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 3, Touché) by maxwell demon on Tuesday July 04 2017, @06:43PM (1 child)

    by maxwell demon (1608) Subscriber Badge on Tuesday July 04 2017, @06:43PM (#534876) Journal

    The failure mode for attempting to run a process with "invalid" credentials should NEVER be "run it as root".

    Nah, if Poettering implements this that way, it's obviously exactly the right thing. To follow his lead, I'm going to patch login with the following code:

    if (valid(user, password))
      login_as(user);
    else
      login_as(USER_ROOT);

    SCNR :-)

    --
    The Tao of math: The numbers you can count are not the real numbers.
    Starting Score:    1  point
    Moderation   +1  
       Touché=1, Total=1
    Extra 'Touché' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   3  
  • (Score: 2) by DECbot on Wednesday July 05 2017, @04:40PM

    by DECbot (832) on Wednesday July 05 2017, @04:40PM (#535258) Journal

    I understand it to be a little more complex than that...

    if (system.valid(user, password))
        try{ login_as(systemd.valid(user)); }
        catch(NoSuchSystemdUserException ex){ login_as(USER_ROOT); }
    else
        throw new NoSuchUserException("User not found");

    --
    cats~$ sudo chown -R us /home/base