• dbx12@programming.dev
    link
    fedilink
    arrow-up
    55
    ·
    2 days ago

    I already found another one!

    echo $USER prints my current user name. Once I do USER=root it shows im running as root. And I wasn’t even asked for my sudo password! :O :O :O

        • clb92@feddit.dk
          link
          fedilink
          arrow-up
          1
          ·
          11 hours ago

          Youre going to need a catchy name and a website for it as well. All the big CVEs have a website and a catchy name now.

    • goferking (he/him)@lemmy.sdf.org
      link
      fedilink
      arrow-up
      20
      arrow-down
      3
      ·
      2 days ago

      You joke but at work our security office mass reset passwords because they saw a list of users in the pwd file. Even after others pointed out it was just a list of usernames not their credentials AND that it couldn’t be the actual credentials as we’re an AD shop

      They would definitely fall for that 😭

      • dbx12@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        1 day ago

        The interesting thing is that bash allows writing this variable. I would’ve expected it to be readonly for obvious reasons.

        • poolcritter@pawb.social
          link
          fedilink
          arrow-up
          1
          ·
          19 hours ago

          USER is just an environment variable in the environment block like any other; even if Bash didn’t allow changing it, any other program could.

        • 🌞 Alexander Daychilde 🌞@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          21 hours ago

          Right? And while Linux generally seems to let you shoot yourself in your foot if you’d really like to, things like --no-preserve-root mean they do put SOME guardrails out there. lol. $USER seems worth making immutable. heh