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: 2) by butthurt on Tuesday July 04 2017, @11:26PM (2 children)

    by butthurt (6141) on Tuesday July 04 2017, @11:26PM (#534971) Journal

    Many user management tools accept either user names or UID’s as arguments.

    chown is one tool that accepts either user names or UID’s.

    This makes root the owner of example.txt:

    chown 0 example.txt

    Having a non-privileged user with the user name zero would be very dangerous.

    -- http://paulgorman.org/technical/presentations/linux_username_conventions.pdf [paulgorman.org]

    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 1, Insightful) by Anonymous Coward on Wednesday July 05 2017, @09:29AM (1 child)

    by Anonymous Coward on Wednesday July 05 2017, @09:29AM (#535117)

    Usernames starting with digits are not the same as numeric user names. Numeric user names would be user names that entirely consist of digits.

    That's not unlike the fact that 123.com is a valid domain name, while 127.0.0.1 is not.

    • (Score: 2) by butthurt on Thursday July 06 2017, @12:25AM

      by butthurt (6141) on Thursday July 06 2017, @12:25AM (#535469) Journal

      A username consisting entirely of digits begins with a digit, doesn't it? Numeric usernames are a subset of the usernames which begin with digits. The given example, a username of "0", is a valid username. However, the essay I linked discourages such usernames. On the same page (page 14) it discourages usernames which begin with a digit but contain other characters--which, according to POSIX, can also be valid. Instead of commenting about those, I commented about purely numeric usernames because the reason for the essay's recommendation against purely numeric usernames is easier to understand.