I think it sounds more plausible that someone thought "you feed a corrupt sqlite db file to it" is a CVE, when accepting untrusted db files is not the intended usage.
Conversation
That is the intended usage of SQLite. That's part of the threat model for it in the real world and it certainly aims to be safe in that case. It's also supposed to remain memory safe with a lot of attacker control over the database queries.
1
1
This Tweet was deleted by the Tweet author. Learn more
I didn't say running untrusted SQL. I said "a lot of attacker control over the database queries". If I meant executing arbitrary SQL, that's what I would have said, and I clearly didn't mean that. Please don't misrepresent my statements any more.
1
1
sqlite.org/whentouse.html
> SQLite does not compete with client/server databases. SQLite competes with fopen().
#2 on list of recommend uses
> Application file format
Also listed:
> Data transfer format
And yes, it is widely used this way in the real world, as intended.
1
1
I believe you. This is a highly irresponsible recommendation, both from a security perspective and a design one, and ppl should ignore it.
This Tweet was deleted by the Tweet author. Learn more
Consider something like the XCF file format used by a program like GIMP including all kinds of fancy structured data. People are certainly exchanging these files. SQLite would be a substantially safer base to build on than the current GIMP implementation. I'm quite sure of that.
2
Or heck, .doc or .psd, which are basically just memcpy’d internal structures of Word and Photoshop respectively.
1
That's basically XCF too.
github.com/GNOME/gimp/blo
They're collaborating with the Krita developers to make en.wikipedia.org/wiki/OpenRaster as a replacement. It's probably going to be even more complex though since they're going to want to add more capabilities.
1
2
The solution to the problem cannot be not making this kind of software, or somehow getting users not to exchange media files, image editing files, word processor documents, etc. Really just parse the file format in a memory safe language without dynamic code execution.
And that memory safe language can certainly be a subset of C with annotations / rules that make it memory safe. No problem with that, I just don't think it's a very useful/practical thing to do personally since I'd rather use a nicer language if it has to be from scratch anyway.
1
1
We know how to write software with decent security and these kinds of capabilities. It's not a mystery. We choose to use software architectures and languages making it unrealistic to provide decent security. Even if you claim that it's due to programmer incompetence, not tools...
1
2
3
Show replies

