Live data from Hacker News

Could the XZ backdoor been detected with better Git/Deb packaging practices?

optimizedbyotto.com

111–116 of 116 posts

Re: Could the XZ backdoor been detected with better Git/Deb packaging practices?

#111
post #105

Earlier quoted context omitted.

With a binary, one can compare a hash or store a copy on the binary on another computer. And one person doing this might be enough to figure out something is wrong. But even if people don't, it needs additional effort by the attacker to search for the binary and clean up their tracks, which also creates more opportunities for detection. It is really not at all comparable to "curl | bash". You sound like the people wh…

> With a binary, one can compare a hash You lift a suspected binary from a machine that's under suspicion. You hash it and it matches a known good file. You declare victory, pat yourself on the back, and return it back into service. 3 months later all of your data is exfiltrated because you assumed that your attacker is an idiot. > it needs additional effort by the attacker to search for the binary Additional effort:…

You can copy the binary on a different system before installing it, or compute the hash before you run it. This is not hard. And even if you are not copying to another system, the attacker needs to find all copies of the binary and modify them. Also note that the installer binary / script is not the same as the binary that later runs. And any additional effort the attacker has to do to hide its tracks also increases chances for detection, this is also something that can be learned from XZ backdoor.

Re: Could the XZ backdoor been detected with better Git/Deb packaging practices?

#112

Earlier quoted context omitted.

Because historically, what's in a release tarball is not what's in the repository. In many cases, the release tarball of an old C/autoconf project has "half-built". Debian has always worked from the release tarballs, and thus if you "just" import Debian packaging into a VCS, you don't necessarily track every upstream commit, just the releases. (Independently importing release tarballs into VCS also worked better in t…

I think you're either confused, or have attached your comment to the wrong parent? My observations and questions were about the GNU bash git repo and how (and why) the bash maintainers do release branching and tagging. They were not about how the Debian folks handle their packaging.

Oh yeah. The thread before that talked about Debian packaging.

Re: Could the XZ backdoor been detected with better Git/Deb packaging practices?

#113
post #102
post #42

Earlier quoted context omitted.

The question of whether the xz format is a good choice for long-term archival is entirely unrelated to backdoors or open source supply chain security.

No they're the same. Why do you think xz was targeted? It's a giant slippery hairball.

> Why do you think xz was targeted?

Possibly for any number of reasons. A sole maintainer with a bit too little capacity to keep up the development. A central role as a dependency for crucial packages in a couple of key distros.

What would be the connection between the backdoor (or indeed any supply chain security) and any design details of the xz file format? How would the backdoor have been avoided if the archive format were different?

Re: Could the XZ backdoor been detected with better Git/Deb packaging practices?

#114
post #69

Earlier quoted context omitted.

The next one probably won't be caught by running noticeably slower than usual. It was a pure fluke that it got discovered _this early_.

If I remember correctly it's days were numbered as soon as that redhat bug report on the valgrind errors piling up was made. They weren't the ones to find the cause first (that's the person who took a deeper look due to the slowness), but the red flags had been raised.

Yes indeed. The backdoor author did try to claim that it was a false positive (and I’m sure that a very depressingly large number of people would happily go along with such a claim even without a scrap of evidence).

The error was related to the use of the frame pointer. Optimised code does not use RBP as the frame pointer, only using RSP for stack addresses. The XZ backdoor code assumed that the stack used this layout. The RedHat regression tests use debug builds that do use the frame pointer. The result was the backdoor code writing below the bottom of the stack.

I suspect also that Valgrind is unique in finding issues like this. Other tools do not check all memory accesses before main. Valgrind loads and runs the test binary from the very beginning and thus it detected errors in the ifunc code used by XZ that executed very early on during ld.so loading and symbol resolution.

Re: Could the XZ backdoor been detected with better Git/Deb packaging practices?

#115
post #113
post #102

Earlier quoted context omitted.

No they're the same. Why do you think xz was targeted? It's a giant slippery hairball.

> Why do you think xz was targeted? Possibly for any number of reasons. A sole maintainer with a bit too little capacity to keep up the development. A central role as a dependency for crucial packages in a couple of key distros. What would be the connection between the backdoor (or indeed any supply chain security) and any design details of the xz file format? How would the backdoor have been avoided if the archive f…

[deleted]

Re: Could the XZ backdoor been detected with better Git/Deb packaging practices?

#116
post #60

Earlier quoted context omitted.

This is not going to be popular: I think the whole idea that a build system just fetches resources from outside of the build environment is fundamentally broken. It invites all kinds of trouble and makes it next to impossible to really achieve stability and to ensure that all code that is in the build has been verified. Because after you've done it four times the fifth time you won't be looking closely. But if you do…

I completely agree with you - I think that automatic downloading of dependencies when building is a bad idea. However, for the sake of devil's advocacy, I do also want to point out that the first thing a lot of people used to do after downloading and extracting a source tarball was to run "./configure" without even looking at what it is they were executing - even people who (rightly) hate the "curl | bash" combo. You…

> I think that automatic downloading of dependencies when building is a bad idea.

Unless the dependencies are properly pinned and hashed.

Post reply on HN