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: 1, Interesting) by Anonymous Coward on Tuesday July 04 2017, @03:16AM (1 child)

    by Anonymous Coward on Tuesday July 04 2017, @03:16AM (#534660)

    Text logs are fine, just add another file with pointers or any other helper metadata new tools can need. Similar to BSD vipw and pwd_mkdb handling and checking text and binary files so they always valid, easily "grepable" (text ones) or fast via API/ABI (bin ones), in sync and simple to recover if something goes wrong.

    Bonus: the text log files can be set to append only (see chattr(1)). Then set owner to something except the logger process, and the group to logger process so it can writeappend. Magic: now modification or deletion of past logs needs root or whatever owner the file has, so comprossing the logger is not enough.

    But you know, defense in depth is hard to grok. Another level would be shipping copies of logs to a different machine, and both local and remote would still use this append-only trick. But for standalone machines the append-only method would be an improvement.

    Starting Score:    0  points
    Moderation   +1  
       Interesting=1, Total=1
    Extra 'Interesting' Modifier   0  

    Total Score:   1  
  • (Score: 2) by Thexalon on Tuesday July 04 2017, @05:27PM

    by Thexalon (636) on Tuesday July 04 2017, @05:27PM (#534846)

    The point is, even if you accept that journald is useful (an open question), they're doing it wrong.

    --
    The only thing that stops a bad guy with a compiler is a good guy with a compiler.