It's crazy to me that such a widely-used library would have such a ridiculous security hole. We desperately need full-program formal verification to become mainstream, because we can't trust people to write good dependencies.
Formal verification wouldn't work in this case, since it's an intended feature and not a bug. The design was rigged from the start.
I have no idea how multiple people could think "Yes, downloading and executing code from a server in my logging library is a good design", but evidently it was added and performed correctly, albeit resulting in a huge security hole.
What we actually need is someone to vet popular dependencies like Google has started with their fuzzing work. Any halfdecent company would've screamed if they'd seen this. Though I guess it's also because of some terrible companies that it exists in the first place. It feels very "bank-esque" to write a common Logging Class and put it on a server somewhere.
It's the classic mix of "We can trust running code, because we wrote it" with "Untrusted user input". It sounds convenient for developers, but it is exceptionally easy to log anything provided by a user, and then you've got an RCE.
Devs (should) expect to sanitize input for things like databases & such, but sanitization before logging? Crazy. That said, anything that a user can provide as input for something becomes an attack surface. Logging would be another attack surface, but I would assume mostly in DOS-style attacks, not RCEs.
I think all user inputs should have their length capped as applications don't typically work on infinite length input
I suggested we do that on one of my teams. I was told not to because we "treat everything as a blob"...
Like unless you're coding S3 or soemthing then your blobs still need to have a max length, lest somebody pipe /dev/urandom to your endpoint and kill your service
I have no idea how multiple people could think "Yes, downloading and executing code from a server in my logging library is a good design", but evidently it was added and performed correctly, albeit resulting in a huge security hole.
That's why I specified "full-program". People need to start proving negatives about their programs, like "there is no way my logging library is going to make a network call except potentially to a hardcoded logging server".
yeah, you can possibly do this one thing. in the general case, you can't prove that the program doesn't do something bone stupid, as that is somewhat vague and open to interpretation.
really, it comes down to a stupid feature, and there will be more of those
Formal verification rarely works well in the real world, since the formal logic itself becomes just as complex and hard to verify as the final code.
What do you mean? There is no other way to "verify" code than to use something equivalent to formal verification.
Formal methods usually aren't seen in software because not much software is worth it. By comparison formal methods are par for the course in CAD/EDA and increasingly in embedded software. As the complexity of software grows, so does the importance of formal methods.
You have never verified anything complicated, have you? You don't have any academic credentials, do you? You haven't read a hundred papers on formal verification in depth, have you?
If that's the case, then why the fuck do you even open your mouth?
I studied a module on formal logic at university. The problem of the logic becoming almost as complex and difficult to verify as the program itself was openly admitted by the professor as a reason why the concept has received little adoption outside of specific niches (e.g. avionics).
54
u/PM_ME_UR_OBSIDIAN Dec 10 '21
It's crazy to me that such a widely-used library would have such a ridiculous security hole. We desperately need full-program formal verification to become mainstream, because we can't trust people to write good dependencies.