News for hackers. Stuff that matters.
Re:Could the XZ backdoor been detected with better Git/Deb p... by Groxx on Sunday October 19, 2025 @04:36PM (#45637717)
mostly no, from my reading - it was a multi-stage chain of relatively normal looking things that added up to an exploit. helped by the tests involved using compressed data that wasn't human-readable.

you can of course come up with ways it could have been caught, but the code doesn't stand out as abnormal in context. that's all that really matters, unless your build system is already rigid enough to prevent it, and has no exploitable flaws you don't know about.

finding a technical overview is annoyingly tricky, given all the non-technical blogspam after it, but e.g. https://securelist.com/xz-backdoor-story-part-1/112354/ looks pretty good from a skim.

Re:Could the XZ backdoor been detected with better Git/Deb p... by sanjams on Sunday October 19, 2025 @05:14PM (#45638051)
The article references a technical write-up: https://research.swtch.com/xz-script
Re:Could the XZ backdoor been detected with better Git/Deb p... by Groxx on Sunday October 19, 2025 @06:08PM (#45638487)
ah, yes, this is one I remember seeing early on! thank you! I couldn't find much past the blogspam this time :/
Re:Could the XZ backdoor been detected with better Git/Deb p... by XorNot on Sunday October 19, 2025 @04:52PM (#45637856)
Compression algorithms are deterministic over fixed data though (possibly with some effort).

There's no good reason to have opaque, non generated data in the repository and it should certainly be a red flag going forwards.

Re:Could the XZ backdoor been detected with better Git/Deb p... by Groxx on Sunday October 19, 2025 @04:55PM (#45637888)
committed files with carefully crafted bad data is extremely common for testing how your code handles invalid data, especially with regression tests. and lzma absolutely needs to test itself against bad, possibly-malicious data.
Re:Could the XZ backdoor been detected with better Git/Deb p... by crote on Sunday October 19, 2025 @06:14PM (#45638523)
Yes, but the carefully crafted bad data should be explainable.

Instead of committing blobs, why not commit documented code which generates those blobs? For example, have a script compress a bunch of bytes of well-known data, then have it manually corrupt the bytes belonging to file size in the archive header.

Re:Could the XZ backdoor been detected with better Git/Deb p... by uecker on Monday October 20, 2025 @03:01AM (#45640729)
Maybe, but it is generally much more work to do than including a minimized test case which may already exist. But I would argue that binary blobs for testing are not the problem but the code that allows things from a binary blob to be executed during building and/or later at run-time.
Re:Could the XZ backdoor been detected with better Git/Deb p... by sanjams on Sunday October 19, 2025 @05:15PM (#45638059)
I agree, but perhaps OP is suggesting that the hand-crafted data can be generated in a more transparent way. For example, via a script/tool that itself can be reviewed.
Re:Could the XZ backdoor been detected with better Git/Deb p... by Groxx on Sunday October 19, 2025 @06:16PM (#45638537)
could have, absolutely.

should not have been in any commit, which is basically necessary to prevent this case, almost definitely not. it's normal, and requiring all data to be generated just means extremely complicated generators for precise trigger conditions... where you can still hide malicious data. you just have to obfuscate it further. which does raise the difficulty, which is a good thing, but does not make it impossible.

I completely agree that it's a good/best practice, but hard-requiring everywhere it has significant costs for all the (overwhelmingly more common) legitimate cases.

Re:Could the XZ backdoor been detected with better Git/Deb p... by XorNot on Monday October 20, 2025 @05:42AM (#45641931)
It would be reasonable for error case data though to be thoroughly explained, and it must be explainable since otherwise what are you testing and why does the test exist?

The xz exploit depended on the absence of that explanation but accepting that it was necessary for unstated reasons.

Whereas it's entirely reasonable to have a test that says something like: "simulate an error where the header is corrupted with early nulls for the decoding logic" or something - i.e. an explanation, and then a generator which flips the targeted bits to their values.

Sure: you _could_ try inserting an exploit, but now changes to the code have to also surface plausible data changes inline with the thing they claim is being tested.

I wouldn't even regard that as a lot of work: why would a test like that exist, if not because someone has an explanation for the thing they want to test?

Re:Could the XZ backdoor been detected with better Git/Deb p... by secondcoming on Sunday October 19, 2025 @05:10PM (#45638020)
There are tons of reasons to have hand-crafted data in a repository.