Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
Possibly linux ( possiblylinux127@lemmy.zip )  to Linux@lemmy.mlEnglish · 3 years ago

XZ backdoor in a nutshell

lemmy.zip

message-square
54
link
fedilink
  • cross-posted to:
  • linux@lemmy.eco.br
711

XZ backdoor in a nutshell

lemmy.zip

Possibly linux ( possiblylinux127@lemmy.zip )  to Linux@lemmy.mlEnglish · 3 years ago
message-square
54
link
fedilink
  • cross-posted to:
  • linux@lemmy.eco.br
alert-triangle
You must log in or register to comment.
  • Aatube ( Aatube@kbin.melroy.org ) 
    link
    fedilink
    arrow-up
    149
    ·
    3 years ago

    Don’t forget all of this was discovered because ssh was running 0.5 seconds slower

    • Jolteon ( Jolteon@lemmy.zip ) 
      link
      fedilink
      arrow-up
      51
      ·
      3 years ago

      Half a second is a really, really long time.

    • imsodin ( imsodin@infosec.pub ) 
      link
      fedilink
      arrow-up
      36
      ·
      3 years ago

      Technically that wasn’t the initial entrypoint, paraphrasing from https://mastodon.social/@AndresFreundTec/112180406142695845 :

      It started with ssh using unreasonably much cpu which interfered with benchmarks. Then profiling showed that cpu time being spent in lzma, without being attributable to anything. And he remembered earlier valgrind issues. These valgrind issues only came up because he set some build flag he doesn’t even remember anymore why it is set. On top he ran all of this on debian unstable to catch (unrelated) issues early. Any of these factors missing, he wouldn’t have caught it. All of this is so nuts.

    • Possibly linux ( possiblylinux127@lemmy.zip ) OP
      link
      fedilink
      English
      arrow-up
      33
      ·
      3 years ago

      Postgres sort of saved the day

      • Hupf ( Hupf@feddit.de ) 
        link
        fedilink
        arrow-up
        17
        ·
        3 years ago

        RIP Simon Riggs

        • acockworkorange ( acockworkorange@mander.xyz ) 
          link
          fedilink
          arrow-up
          6
          ·
          3 years ago

          https://www.postgresql.org/about/news/remembering-simon-riggs-2830/

    • oce 🐆 ( oce@jlai.lu ) 
      link
      fedilink
      arrow-up
      23
      ·
      3 years ago

      Is that from the Microsoft engineer or did he start from this observation?

  • gregorum ( gregorum@lemm.ee ) Banned from community
    link
    fedilink
    English
    arrow-up
    79
    ·
    3 years ago

    Thank you open source for the transparency.

  • d3Xt3r ( d3Xt3r@lemmy.nz ) deleted by creator
    link
    fedilink
    arrow-up
    64
    ·
    3 years ago

    This is informative, but unfortunately it doesn’t explain how the actual payload works - how does it compromise SSH exactly?

    • Aatube ( Aatube@kbin.melroy.org ) 
      link
      fedilink
      arrow-up
      36
      ·
      3 years ago

      It allows a patched SSH client to bypass SSH authentication and gain access to a compromised computer

      • d3Xt3r ( d3Xt3r@lemmy.nz ) deleted by creator
        link
        fedilink
        arrow-up
        42
        ·
        edit-2
        3 years ago

        From what I’ve heard so far, it’s NOT an authentication bypass, but a gated remote code execution.

        There’s some discussion on that here: https://bsky.app/profile/filippo.abyssdomain.expert/post/3kowjkx2njy2b

        But it would be nice to have a similar digram like OP’s to understand how exactly it does the RCE and implements the SSH backdoor. If we understand how, maybe we can take measures to prevent similar exploits in the future.

        • underisk ( underisk@lemmy.ml ) 
          link
          fedilink
          arrow-up
          19
          ·
          3 years ago

          I think ideas about prevention should be more concerned with the social engineering aspect of this attack. The code itself is certainly cleverly hidden, but any bad actor who gains the kind of access as Jia did could likely pull off something similar without duplicating their specific method or technique.

        • The Doctor ( drwho@beehaw.org ) 
          link
          fedilink
          English
          arrow-up
          8
          ·
          3 years ago

          Somebody wrote a PoC for it: https://github.com/amlweems/xzbot#backdoor-demo

          Basically, if you have a patched SSH client with the right ED448 key you can have the gigged sshd on the other side run whatever commands you want. The demo just does id > /tmp/.xz but it could be whatever command you want.

        • baseless_discourse ( baseless_discourse@mander.xyz ) deleted by creator
          link
          fedilink
          arrow-up
          6
          ·
          edit-2
          2 years ago

          deleted by creator

          • Aatube ( Aatube@kbin.melroy.org ) 
            link
            fedilink
            arrow-up
            5
            ·
            3 years ago

            5.6.1 in fact made it less resources-intensive, but the distro happened to not have updated yet when Freund discovered the backdoor.

          • Cochise ( Cochise@lemmy.eco.br ) 
            link
            fedilink
            arrow-up
            2
            ·
            3 years ago

            Authentication bypass should give you interactive access. “I’m in” like. Remote code execution only allows you to run a command, without permanent access. You can use some RCE vulnerabilities to bypass authentication, but not all.

            • baseless_discourse ( baseless_discourse@mander.xyz ) deleted by creator
              link
              fedilink
              arrow-up
              2
              ·
              edit-2
              2 years ago

              deleted by creator

        • Aatube ( Aatube@kbin.melroy.org ) 
          link
          fedilink
          arrow-up
          1
          ·
          3 years ago

          Under the right circumstances this interference could potentially enable a malicious actor to break sshd authentication and gain unauthorized access to the entire system remotely. —Wikipedia, sourced to RedHat

          Of course, the authentication bypass allows remote code execution.

    • Possibly linux ( possiblylinux127@lemmy.zip ) OP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      3 years ago

      I do believe it does

    • uis ( uis@lemm.ee ) 
      link
      fedilink
      arrow-up
      2
      ·
      3 years ago

      There is RedHat’s patch for OpenSSH that adds something for systemd, which adds libsystemd as dependency, which has liblzma as its own dependency.

  • UnityDevice ( UnityDevice@startrek.website ) 
    link
    fedilink
    arrow-up
    53
    ·
    3 years ago

    If this was done by multiple people, I’m sure the person that designed this delivery mechanism is really annoyed with the person that made the sloppy payload, since that made it all get detected right away.

    • bobburger ( bobburger@fedia.io ) 
      link
      fedilink
      arrow-up
      13
      ·
      3 years ago

      I like to imagine this was thought up by some ambitious product manager who enthusiastically pitched this idea during their first week on the job.

      Then they carefully and meticulously implemented their plan over 3 years, always promising the executives it would be a huge pay off. Then the product manager saw the writing on the wall that this project was gonna fail. Then they bailed while they could and got a better position at a different company.

      The new product manager overseeing this project didn’t care about it at all. New PM said fuck it and shipped the exploit before it was ready so the team could focus their work on a new project that would make new PM look good.

      The new project will be ready in just 6-12 months, and it is totally going to disrupt the industry!

      • nxdefiant ( nxdefiant@startrek.website ) 
        link
        fedilink
        arrow-up
        16
        ·
        3 years ago

        I see a dark room of shady, hoody-wearing, code-projected-on-their-faces, typing-on-two-keyboards-at-once 90’s movie style hackers. The tables are littered with empty energy drink cans and empty pill bottles.

        A man walks in. Smoking a thin cigarette, covered in tattoos and dressed in the flashiest interpretation of “Yakuza Gangster” imaginable, he grunts with disgust and mutters something in Japanese as he throws the cigarette to the floor, grinding it into the carpet with his thousand dollar shoes.

        Flipping on the lights with an angry flourish, he yells at the room to gather for standup.

        • MonkeMischief ( MonkeMischief@lemmy.today ) 
          link
          fedilink
          arrow-up
          7
          ·
          3 years ago

          Cigarette is stomped.

          Stickies fall from kanban board.

          Backdoor dishonor.

  • uis ( uis@lemm.ee ) 
    link
    fedilink
    arrow-up
    47
    ·
    3 years ago

  • Fat Tony ( FatTony@lemm.ee ) 
    link
    fedilink
    arrow-up
    40
    ·
    3 years ago

    In a nutshell you say…

    • alphafalcon ( alphafalcon@feddit.de ) 
      link
      fedilink
      arrow-up
      26
      ·
      3 years ago

      Coconut at least…

  • noddy ( noddy@beehaw.org ) 
    link
    fedilink
    arrow-up
    29
    ·
    3 years ago

    The scary thing about this is thinking about potential undetected backdoors similar to this existing in the wild. Hopefully the lessons learned from the xz backdoor will help us to prevent similar backdoors in the future.

    • Possibly linux ( possiblylinux127@lemmy.zip ) OP
      link
      fedilink
      English
      arrow-up
      19
      ·
      3 years ago

      I think we need focus on zero trust when it comes to upstream software

      • jackpot ( jackpot@lemmy.ml ) BannedBanned
        link
        fedilink
        arrow-up
        2
        ·
        3 years ago

        exactly, stop depending on esoteric libraries

        • Possibly linux ( possiblylinux127@lemmy.zip ) OP
          link
          fedilink
          English
          arrow-up
          1
          ·
          3 years ago

          It is fine to use them just know how they work and check the commit log.

          That of course requires you to pull from got instead of a tarball

          • billgamesh ( billgamesh@lemmy.ml ) 
            link
            fedilink
            arrow-up
            1
            ·
            3 years ago

            this was well hidden. not sure anyone would have spotted this by checking commit log

            • Possibly linux ( possiblylinux127@lemmy.zip ) OP
              link
              fedilink
              English
              arrow-up
              1
              ·
              3 years ago

              It was hidden in the Tarball

              • billgamesh ( billgamesh@lemmy.ml ) 
                link
                fedilink
                arrow-up
                1
                ·
                3 years ago

                i’m not an expert, but my reading was that it was hidden in a binary used for testing EDIT: oh yeah, i see what you mean

  • girlfreddy ( girlfreddy@lemmy.ca ) 
    link
    fedilink
    arrow-up
    29
    ·
    3 years ago

    A small blurb from The Guardian on why Andres Freund went looking in the first place.

    So how was it spotted? A single Microsoft developer was annoyed that a system was running slowly. That’s it. The developer, Andres Freund, was trying to uncover why a system running a beta version of Debian, a Linux distribution, was lagging when making encrypted connections. That lag was all of half a second, for logins. That’s it: before, it took Freund 0.3s to login, and after, it took 0.8s. That annoyance was enough to cause him to break out the metaphorical spanner and pull his system apart to find the cause of the problem.

    • Possibly linux ( possiblylinux127@lemmy.zip ) OP
      link
      fedilink
      English
      arrow-up
      8
      ·
      3 years ago

      The post on the oss is more detailed and informative

  • Pantherina ( Pantherina@feddit.de ) 
    link
    fedilink
    arrow-up
    23
    ·
    3 years ago

    Original Mastodon post by Andres Freund about discovery

    Original Openwall thread

    Update by @dangoodin@infosec.exchange

    JFrog article

    Bluesky post by another person

    Hacker News article

    Update by the original maintainer

    Wikipedia Article

    Original Mailing history

  • KillingTimeItself ( KillingTimeItself@lemmy.dbzer0.com ) BannedBanned
    link
    fedilink
    English
    arrow-up
    13
    ·
    3 years ago

    this was one hell of an april fools joke i tell you what.

    • Possibly linux ( possiblylinux127@lemmy.zip ) OP
      link
      fedilink
      English
      arrow-up
      3
      ·
      3 years ago

      Imagine

      • KillingTimeItself ( KillingTimeItself@lemmy.dbzer0.com ) BannedBanned
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 years ago

        i mean, to some degree, it is.

  • ☂️- ( umbrella@lemmy.ml ) 
    link
    fedilink
    arrow-up
    12
    ·
    edit-2
    2 years ago

    deleted by creator

    • intrepid ( intrepid@lemmy.ca ) 
      link
      fedilink
      arrow-up
      21
      ·
      3 years ago

      We probably never will.

      • The Doctor ( drwho@beehaw.org ) 
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 years ago

        If we ever do, it’ll be 40 or 50 years from now.

    • Possibly linux ( possiblylinux127@lemmy.zip ) OP
      link
      fedilink
      English
      arrow-up
      7
      ·
      3 years ago

      Probably a state actor

  • etchinghillside ( etchinghillside@reddthat.com ) 
    link
    fedilink
    arrow-up
    10
    ·
    3 years ago

    Any additional information been found on the user?

    • Possibly linux ( possiblylinux127@lemmy.zip ) OP
      link
      fedilink
      English
      arrow-up
      9
      ·
      3 years ago

      Probably Chinese?

      • dan ( dan@upvote.au ) 
        link
        fedilink
        arrow-up
        4
        ·
        3 years ago

        They’re more likely to be based in Eastern Europe based on the times of their commits (during working hours in Eastern European Time) and the fact that while most commits used a UTC+8 time zone, some of them used UTC+2 and UTC+3: https://rheaeve.substack.com/p/xz-backdoor-times-damned-times-and

        • Possibly linux ( possiblylinux127@lemmy.zip ) OP
          link
          fedilink
          English
          arrow-up
          2
          ·
          3 years ago

          It is also hard to be certain as they could be a night owl or a early riser.

          • dan ( dan@upvote.au ) 
            link
            fedilink
            arrow-up
            1
            ·
            3 years ago

            Yeah - The post goes into a lot of detail, and they did take that into account. It’s worth reading.

      • The Doctor ( drwho@beehaw.org ) 
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 years ago

        Just because somebody picked a vaguely Chinese-sounding handle doesn’t mean much about who or where.

        • Possibly linux ( possiblylinux127@lemmy.zip ) OP
          link
          fedilink
          English
          arrow-up
          2
          ·
          3 years ago

          That’s why I put the question mark

    • underisk ( underisk@lemmy.ml ) 
      link
      fedilink
      arrow-up
      8
      ·
      edit-2
      3 years ago

      as long as you’re up to date on everything here: https://boehs.org/node/everything-i-know-about-the-xz-backdoor

      the only additional thing i’ve seen noted is a possibilty that they were using Arch based on investigation of the tarball that they provided to distro maintainers

  • EmperorHenry ( EmperorHenry@discuss.tchncs.de ) deleted by creator
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    2 years ago

    deleted by creator

    • Possibly linux ( possiblylinux127@lemmy.zip ) OP
      link
      fedilink
      English
      arrow-up
      11
      ·
      3 years ago

      A “antivirus” tends to be a proprietary black box. Such “antivirus” programs could not of detected the XZ backdoor

      • EmperorHenry ( EmperorHenry@discuss.tchncs.de ) deleted by creator
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        2 years ago

        deleted by creator

        • Possibly linux ( possiblylinux127@lemmy.zip ) OP
          link
          fedilink
          English
          arrow-up
          3
          ·
          3 years ago

          What?

          • EmperorHenry ( EmperorHenry@discuss.tchncs.de ) deleted by creator
            link
            fedilink
            arrow-up
            2
            ·
            edit-2
            2 years ago

            deleted by creator

            • Possibly linux ( possiblylinux127@lemmy.zip ) OP
              link
              fedilink
              English
              arrow-up
              4
              ·
              3 years ago

              That would do nothing for liblzma as it was trusted.

              • EmperorHenry ( EmperorHenry@discuss.tchncs.de ) deleted by creator
                link
                fedilink
                arrow-up
                1
                ·
                edit-2
                2 years ago

                deleted by creator

                • Possibly linux ( possiblylinux127@lemmy.zip ) OP
                  link
                  fedilink
                  English
                  arrow-up
                  4
                  ·
                  edit-2
                  3 years ago

                  The developer of XZ. What your describing is package verification which already happens

  • expr ( expr@programming.dev ) 
    link
    fedilink
    arrow-up
    2
    ·
    3 years ago

    This whole situation just emphasizes the fact that rebasing >>>>>>>>>> merge squashing.

Linux@lemmy.ml

linux@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !linux@lemmy.ml

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

  • !opensource@lemmy.ml
  • !libre_culture@lemmy.ml
  • !technology@lemmy.ml
  • !libre_hardware@lemmy.ml

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 1 user / week
  • 1 user / month
  • 5.33K users / 6 months
  • 1.31K local subscribers
  • 68.1K subscribers
  • 8.11K Posts
  • 108K Comments
  • Modlog
  • mods:
  • AgreeableLandscape ( AgreeableLandscape@lemmy.ml ) deleted by creator
  • nooter692 ( nooter692@lemmy.ml ) 
  • MarcellusDrum ( MarcellusDrum@lemmy.ml ) 
  • Arthur Besse ( cypherpunks@lemmy.ml ) 
  • Cyclohexane ( cyclohexane@lemmy.ml ) 
  • d3Xt3r ( d3Xt3r@lemmy.nz ) deleted by creator
  • BE: 0.19.21
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code