Episode 224

Episode 224

Update: 2024-04-05
Share

Description

Overview


It’s been an absolutely manic week in the Linux security community as the news
and reaction to the recent announcement of a backdoor in the xz-utils project
was announced late last week, so we dive deep into this issue and discuss how it
impacts Ubuntu and give some insights for what this means for the open source
and Linux communities in the future.


This week in Ubuntu Security Updates


20 unique CVEs addressed


[USN-6718-2] curl vulnerability



  • 1 CVEs addressed in Xenial ESM (16.04 ESM), Bionic ESM (18.04 ESM)



[USN-6719-1] util-linux vulnerability



  • 1 CVEs addressed in Focal (20.04 LTS), Jammy (22.04 LTS), Mantic (23.10)



[USN-6686-5] Linux kernel (Intel IoTG) vulnerabilities



[USN-6715-1] unixODBC vulnerability



  • 1 CVEs addressed in Xenial ESM (16.04 ESM), Bionic ESM (18.04 ESM), Focal (20.04 LTS), Jammy (22.04 LTS), Mantic (23.10)



[USN-6704-4] Linux kernel (Intel IoTG) vulnerabilities



[USN-6707-4] Linux kernel (Azure) vulnerabilities



[USN-6720-1] Cacti vulnerability



Goings on in Ubuntu Security Community


xz-utils backdoor and Ubuntu



  • https://www.openwall.com/lists/oss-security/2024/03/29/4

  • Late last week, 28th / 29th March backdoor in liblzma from xz-utils was
    disclosed to the open source community via oss-security mailing list - this
    was in the recent 5.6.0/5.6.1 releases from late Feb/early March this year

  • initially the impact was not entirely clear - assumed initially that it may
    impact only xz-utils and so only in handling of xz compressed data / files -
    but even with that assumption that perhaps it could then infect anything that
    got compressed/decompressed

  • within a few hours though became clear that the primary target was not
    xz-utils/liblzma itself but openssh - and the affect was to provide a backdoor
    into openssh that would allow the attacker to get remote access to any machine
    running ssh server with this backdoor liblzma installed

  • To paint a picture - this was all unfolding on late Thursday / Friday of the
    Easter break, so lots of folks were either EOD or on leave etc - and trying to
    grapple with a threat that we knew could possibly impact the impedending 24.04
    LTS release




  • Good news:

  • TL;DR for Ubuntu, this version was only ever in the -proposed pocket for the
    currently in-development 24.04 release - not in any other Ubuntu versions -
    and was removed as soon as we became aware, so unless you are running the
    devel release AND you had manually opted to install this version from the
    -proposed pocket, you would not be affected - very lucky

  • https://discourse.ubuntu.com/t/xz-liblzma-security-update/43714

  • What do we know about this? A lot - there has been significant investigation
    (and speculation) since it was announced, both at the social side of things
    and the technical aspects of the backdoor itself

  • For the purpose of the podcast, we won’t go too deep into either but will try
    and cover the salient details

  • Regarding the inclusion of the backdoor itself - looks to have been a very
    long and patient campaign by the attacker, who slowly gained the trust of the
    upstream project over the last 2 years and likely pressured the maintainer via
    sock-puppet accounts to then get themselves added as an additional maintainer

  • Since then they seemed to be quite a good maintainer themselves - diligently
    adding new features and bug fixes etc over the past 2 years, but then suddenly
    introduced the backdoor into the most recent 2 releases

  • The method of introducing the backdoor was also interesting, in that it
    required 2 parts - the binary containing the backdoor and the code to get this
    compiled into the liblzma library at build time

    • The binary was committed into the upstream git repo disguised as an xz
      archive itself used as part of the test suite

    • The code to inject this into the build was NOT part of the git repo, but
      instead was just in the tarball prepared by the maintainer for the official
      release

    • And it used many levels of obfuscation to hide this backdoor within that
      fake test xz archive



  • So the attacker was not just patient but also very technically skilled - and
    not just multiple levels of obfuscation in the build process but the backdoor
    code itself contained many elements to try and make it harder to recognise and
    reverse engineer, presumably to allow it to hide in plain sight

    • although as we will see, this runtime obfuscation within the backdoor binary
      was what gave it away eventually



  • It’s often said that one of the advantages of Open Source is the huge
    community, which is summarised as Linus’ Law - with enough eyeballs all bugs
    are shallow - but sadly this wasn’t proven out in this case

  • Backdoor was not
    found by anyone doing review of the changes upstream or by the various distros
    like Debian / Fedora / OpenSUSE / Arch or even Ubuntu when incorporating this
    new version into their repos - but instead was found by Andres Freund, one of
    the maintainers of PostgreSQL, when they were looking to benchmark some new
    changes scheduled for the next PostgreSQL release

  • Luckily decided to use Debian unstable for this, and Debian had incorporated
    this new version into unstable a few weeks ago, and wanted to get the
    performance noise floor of the system as low as possible before doing
    benchmarking of PostgreSQL - noticed large transient CPU spikes in sshd and
    then eventually weird memory errors in sshd due to bugs in the initial version
    of the backdoor

  • After a lot of painstaking work was able to determine that liblzma was the
    culprit and appeared to contain some very strange code to hook into the
    authentication process of sshd when it was launched via systemd

  • Was able to trace that back to the aforementioned manually prepared tarballs
    of xz-utils on Github

  • The CPU spikes Andres observed were due to the use of things like a trie to
    lookup symbol names at runtime, rather than directly
Comments 
In Channel
Episode 243

Episode 243

2024-12-2024:00

Episode 242

Episode 242

2024-11-2919:40

Episode 241

Episode 241

2024-11-1418:16

Episode 240

Episode 240

2024-10-3136:22

Episode 239

Episode 239

2024-10-1839:16

Episode 238

Episode 238

2024-10-0431:39

Episode 237

Episode 237

2024-09-2016:16

Episode 236

Episode 236

2024-09-0618:23

Episode 235

Episode 235

2024-08-2317:40

Episode 234

Episode 234

2024-08-0929:11

Episode 233

Episode 233

2024-08-0224:07

Episode 232

Episode 232

2024-07-0529:20

Episode 231

Episode 231

2024-06-2819:00

Episode 230

Episode 230

2024-06-2021:12

Episode 229

Episode 229

2024-05-3113:22

Episode 228

Episode 228

2024-05-2415:33

Episode 227

Episode 227

2024-05-0324:41

Episode 226

Episode 226

2024-04-1923:59

Episode 225

Episode 225

2024-04-1219:42

Episode 224

Episode 224

2024-04-0528:49

loading
00:00
00:00
x

0.5x

0.8x

1.0x

1.25x

1.5x

2.0x

3.0x

Sleep Timer

Off

End of Episode

5 Minutes

10 Minutes

15 Minutes

30 Minutes

45 Minutes

60 Minutes

120 Minutes

Episode 224

Episode 224

Ubuntu Security Team