This sort of work has big implications in signature generation for malware samples, for clustering families of samples as well as finding common functions to generate detections on. You couldn't necessarily throw this into a detection engine, because we don't have a fast (dedicated) function recovery tool for binaries, but you can absolutely use it to generate byte based detection from a seed of a few samples.
Rather than having hash based signatures you could generate signatures that cover many samples (and likely new ones) in bulk. Normally a good signature like that requires manual effort from an analyst, this is a step toward machines doing it. As well, a central authoritative name database that could say "this is Petya" could force some sane naming convention on the industry (every AV wouldn't just be like "it's Zbot lol").
This stuff can even aid manual reverse engineering. You could build a function naming database that uses this. Maybe a new engine for Talos FIRST. [1] Then if you opened up a file without debug symbols this could match it to known functions and really speed up reverse engineering efforts.
I look forward to reading it in more detail tomorrow. Thanks to Halvar for putting this out.
Huh! This obviously desirable property of a good hash function for this application is one of the classic undesirable properties of a good hash function for cryptography. I don't think that I was previously familiar with this sort of hash function, very cool.
Are space-filling curves related to these hash functions?
---
If you want to know more, I'd suggest researching Locality Sensitive Hashing. Flann[1] has a decent implementation.
My favorite approach was single repository compiling optimized binaries with the specific versions of the libs wanted (in case of weird regression) and pushing these static binaries to the rest of the network.
After the zlib debacle, no more: I only use that approach for very specific mission critical tools, where I do not trust ansible or even linux distributions.
The sqlite 0 day may have reignited the same fears in those too young to remember grepping various zlib signatures on binaries -not just yours (you central repository can easily push new version to your network) but the other tools you don't necessary control.
Even the idea of stable versions of libraries with security patches seems to be a dieing one.
This is incorrect, Rust supports dynamic linking.
I don’t know any native language that can do this in a better way.
I would have preferred for myself, and my customers to just upgrade openssl.
I am still a big fan of static binaries though, they more than make up for their downsides.
I suppose my gut feeling is that it's more prone to issues of human error - why should I have to recompile my application if the security hole was found in a library I've linked to? With dynamic linking, assuming you're publishing your software for an OS with a conscientious approach to security patches, ie. pretty much all the major ones, it's a solved problem. With static linking, if you forget to update your binary, well, it's your problem.
I should have been more specific. I explained my reason below on https://news.ycombinator.com/item?id=18713442
Even if the company rebuilds everything, there's a huge benefit in knowing that you are using a well tested release instead of a less popular one or an internal fork.
Also: security teams hate big security patches.
Library substitution is a big problem. If an attacker can get a library into a place where the executable looks for libraries, the attacker gains control.
Merely having the capability to load a dynamic library is an issue. Generally, this means it is possible to load code into the process.
Library ABI mismatches can be security bugs. There can exist two pieces of software that can be installed and used separately without trouble, but which have security bugs when both installed. This happens for example when the second piece of software to be installed brings along an updated library that isn't fully compatible (even bug-for-bug) with the one that the other software came with.
This is a great way to do vulnerability research, surprisingly good malware detection, but a less good way to provide an assurance service.
Great post, and a good step towards the general problem of code reputation.
Marriott breach: someone executed an 0ld day.
You can not always rely on linux distribution to not mess up with a lib, especially if it "obscure" with few users.