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, @08:23PM (4 children)

    by butthurt (6141) on Tuesday July 04 2017, @08:23PM (#534913) Journal

    > There's nothing 'invalid' about a *nix username starting with a null and many, many have done so.

    I disagree. A commenter on Stack Exchange wrote that the allowable characters (according to IEEE Std 1003.1-2001) are:

    The set of characters from which portable filenames are constructed.

    A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
    a b c d e f g h i j k l m n o p q r s t u v w x y z
    0 1 2 3 4 5 6 7 8 9 . _ -

    -- https://www.linuxquestions.org/questions/linux-server-73/valid-user-names-573768/ [linuxquestions.org]

    The summary mentions "usernames that start with a numeric character." A null character is not a numeric character. It's a control character. Perhaps you're confusing it with the zero symbol, "0"?

    https://en.wikipedia.org/wiki/Null_character [wikipedia.org]

    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 1) by Arik on Wednesday July 05 2017, @12:27AM (3 children)

    by Arik (4543) on Wednesday July 05 2017, @12:27AM (#534990) Journal
    C defines things differently and that's fine, but the normal meaning of the word 'null' is precisely the same as 'zero.'
    --
    If laughter is the best medicine, who are the best doctors?
    • (Score: 2) by FatPhil on Wednesday July 05 2017, @08:06AM (1 child)

      by FatPhil (863) <pc-soylentNO@SPAMasdf.fi> on Wednesday July 05 2017, @08:06AM (#535098) Homepage
      Not just C, Unix - you stepped on both toes.
      --
      Great minds discuss ideas; average minds discuss events; small minds discuss people; the smallest discuss themselves
      • (Score: 1) by Arik on Wednesday July 05 2017, @05:23PM

        by Arik (4543) on Wednesday July 05 2017, @05:23PM (#535281) Journal
        You got me, my native tongue is English, and I don't worship Kernighan and Ritchie.
        --
        If laughter is the best medicine, who are the best doctors?
    • (Score: 2) by butthurt on Thursday July 06 2017, @12:37AM

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

      In the context of character sets in computing, they have distinct meanings. In the character set used for POSIX usernames, a printable "0" is different from the non-printable NUL.

      https://en.wikipedia.org/wiki/File:US-ASCII_code_chart.png [wikipedia.org]

      If you refer to "0" as a null, you're just going to cause confusion.