237 points

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

permalink
report
reply
91 points

Its toooo much bloat. There must be malware XD linux users at there peak!

permalink
report
parent
reply
96 points
*

Tbf 500ms latency on - IIRC - a loopback network connection in a test environment is a lot. It’s not hugely surprising that a curious engineer dug into that.

permalink
report
parent
reply
40 points

Especially that it only took 300ms before and 800ms after

permalink
report
parent
reply
80 points

Half a second is a really, really long time.

permalink
report
parent
reply
26 points

reminds of Data after the Borg Queen incident

permalink
report
parent
reply
2 points

Which ep/movie are you referring to?

permalink
report
parent
reply
6 points

If this exploit was more performant, I wonder how much longer it would have taken to get noticed.

permalink
report
parent
reply
52 points

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.

permalink
report
parent
reply
48 points

Postgres sort of saved the day

permalink
report
parent
reply
20 points

RIP Simon Riggs

permalink
report
parent
reply
34 points

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

permalink
report
parent
reply
45 points

From what I read it was this observation that led him to investigate the cause. But this is the first time I read that he’s employed by Microsoft.

permalink
report
parent
reply
15 points

I’ve seen that claim a couple of places and would like a source. It very well may be since Microsoft prefers Debian based systems for WSL and for azure, but its not something I would have assumed by default

permalink
report
parent
reply
124 points

I know this is being treated as a social engineering attack, but having unreadable binary blobs as part of your build/dev pipeline is fucking insane.

permalink
report
reply
39 points

Is it, really? If the whole point of the library is dealing with binary files, how are you even going to have automated tests of the library?

The scary thing is that there is people still using autotools, or any other hyper-complicated build system in which this is easy to hide because who the hell cares about learning about Makefiles, autoconf, automake, M4 and shell scripting at once to compile a few C files. I think hiding this in any other build system would have been definitely harder. Check this mess:

  dnl Define somedir_c_make.
  [$1]_c_make=`printf '%s\n' "$[$1]_c" | sed -e "$gl_sed_escape_for_make_1" -e "$gl_sed_escape_for_make_2" | tr -d "$gl_tr_cr"`
  dnl Use the substituted somedir variable, when possible, so that the user
  dnl may adjust somedir a posteriori when there are no special characters.
  if test "$[$1]_c_make" = '\"'"${gl_final_[$1]}"'\"'; then
    [$1]_c_make='\"$([$1])\"'
  fi
  if test "x$gl_am_configmake" != "x"; then
    gl_[$1]_config='sed \"r\n\" $gl_am_configmake | eval $gl_path_map | $gl_[$1]_prefix -d 2>/dev/null'
  else
    gl_[$1]_config=''
  fi
permalink
report
parent
reply
25 points
*

It’s not uncommon to keep example bad data around for regression to run against, and I imagine that’s not the only example in a compression library, but I’d definitely consider that a level of testing above unittests, and would not include it in the main repo. Tests that verify behavior at run time, either when interacting with the user, integrating with other software or services, or after being packaged, belong elsewhere. In summary, this is lazy.

permalink
report
parent
reply
17 points

and would not include it in the main repo

Tests that verify behavior at run time belong elsewhere

The test blobs belong in whatever repository they’re used.

It’s comically dumb to think that a repository won’t include tests. So binary blobs like this absolutely do belong in the repository.

permalink
report
parent
reply
3 points
*

A repo dedicated to non-unit-test tests would be the best way to go. No need to pollute your main code repo with orders of magnitude more code and junk than the actual application.

That said, from what I understand of the exploit, it could have been avoided by having packaging and testing run in different environments (I could be wrong here, I’ve only given the explanation a cursory look). The tests modified the code that got released. Tests rightly shouldn’t be constrained by other demands (like specific versions of libraries that may be shared between the test and build steps, for example), and the deploy/build step shouldn’t have to work around whatever side effects the tests might create. Containers are easy to spin up.

Keeping them separate helps. Sure, you could do folders on the same repo, but test repos are usually huge compared to code repos (in my experience) and it’s nicer to work with a repo that keeps its focus tight.

It’s comically dumb to assume all tests are equal and should absolutely live in the same repo as the code they test, when writing tests that function multiple codebases is trivial, necessary, and ubiquitous.

permalink
report
parent
reply
2 points

I agree that in most cases it’s more of an E2E or integratiuon test, not sure of the need to split into different repo, and well in the end I’m not sure that would have made any big protection anyhow.

permalink
report
parent
reply
24 points

As mentioned, binary test files makes sense for this utility. In the future though, there should be expected to demonstrate how and why the binary files were constructed in this way, kinda like how encryption algorithms explain how they derived any arbitrary or magic numbers. This would bring more trust and transparency to these files without having to eliminate them.

permalink
report
parent
reply
1 point

You mean that instead of having a binary blob you have a generator for the data?

permalink
report
parent
reply
2 points

Yep, I consider it a failure of the build/dev pipeline.

permalink
report
parent
reply
119 points

Thank you open source for the transparency.

permalink
report
reply
69 points

And thank you Microsoft.

permalink
report
parent
reply
65 points

Shocking, but true.

permalink
report
parent
reply
14 points

They just pay some dude that is doing good work

permalink
report
parent
reply
99 points

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

permalink
report
reply
47 points

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

permalink
report
parent
reply
66 points
*

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.

permalink
report
parent
reply
27 points

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.

permalink
report
parent
reply
8 points

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.

permalink
report
parent
reply
6 points
*

I am not a security expert, but the scenario they describe sounds exactly like authentication bypass to a layman like me.

According to https://www.youtube.com/watch?v=jqjtNDtbDNI the software installs a malicious library that overwrite the signature verification function of ssh.

I was wondering if the bypass function was designed to be slightly less resource intensive, it probably won’t be discovered and will be shipped to production.

Also I have mixed feeling about dynamic linking, on the one hand, it allows projects like harden malloc to easily integrate into the system, on the other hand, it also enables the attacker to hijack the library in a similar fashion.

EDIT: This is a remote code execution exploit, not authentication bypass. The payload is sent as an authentication message and will be executed by the compromised authentication function.

This means:

  • the payload will be executed as root, since sshd run as root.
  • the payload will leave no trace in login log.

So this is much worse than ssh authentication bypass.

permalink
report
parent
reply
3 points
*

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.

permalink
report
parent
reply
4 points

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

permalink
report
parent
reply
-6 points
*

I do believe it does

permalink
report
parent
reply
97 points

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.

permalink
report
reply
33 points

I hope they are all extremely annoyed and frustrated

permalink
report
parent
reply
24 points

Inconvenienced, even.

permalink
report
parent
reply
6 points

Inconceivable!

permalink
report
parent
reply
21 points

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!

permalink
report
parent
reply
26 points
*

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.

permalink
report
parent
reply
12 points
*

Cigarette is stomped.

Stickies fall from kanban board.

Backdoor dishonor.

permalink
report
parent
reply

Linux

!linux@lemmy.ml

Create post

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

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

Community stats

  • 8.1K

    Monthly active users

  • 6.4K

    Posts

  • 174K

    Comments