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: 5, Insightful) by The Mighty Buzzard on Tuesday July 04 2017, @01:48AM (5 children)

    The problem isn't that someone could write a malicious unit file, it's that someone could typo "apahce" and your web server would end up running as root. Substitute your possibly exploitable daemon of choice for apache.

    --
    My rights don't end where your fear begins.
    Starting Score:    1  point
    Moderation   +4  
       Insightful=2, Informative=2, Total=4
    Extra 'Insightful' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   5  
  • (Score: 4, Informative) by jimshatt on Tuesday July 04 2017, @07:29AM (4 children)

    by jimshatt (978) on Tuesday July 04 2017, @07:29AM (#534712) Journal
    Your details are slightly off. Instead of 'apahce' the username should start with a numeric character, e.g. '0pache'. The user may or may not exist, systemd will not accept the username (a feature??) and default to root...

    To rehash your explanation: this isn't an attack vector in itself, because you'd need root to create a malicious init file, but a minor bug in a misconfigured daemon can now suddenly be a gaping security hole.
    • (Score: 2) by The Mighty Buzzard on Tuesday July 04 2017, @10:24AM (2 children)

      Cheers for the correction.

      --
      My rights don't end where your fear begins.
    • (Score: 1, Informative) by Anonymous Coward on Tuesday July 04 2017, @10:30AM

      by Anonymous Coward on Tuesday July 04 2017, @10:30AM (#534754)

      It's not related to starting with a numeric character, it's any invalid (in systemd's view) username, including typos such as apaché.

      The problem with usernames starting with a digit is that those are actually VALID usernames in a posix system, but systemd does not consider them valid. So the fully valid username 0access get root access instead.

      So it's actually two bugs - the security hole that regards any invalid username as root, and the bug that treats any username that starts with a digit as invalid.