3 ms·
Can you elaborate about this? What are the gotchas when opening an untrusted SQLite3 database? (I am developing a web application that will allow users to uplo
by remram 6y ago
Can you elaborate about this? What are the gotchas when opening an untrusted SQLite3 database?
(I am developing a web application that will allow users to upload application files, which are SQLite3 databases)
- kibibyte 6y agoSection 1.2 here might be a good start. https://www.sqlite.org/security.html https://www.sqlite.org/security.html
- hansvm 6y agoI haven't taken the time to verify any of it, but a quick search for "sqlite code execution" doesn't look promising.
- ori_b 6y agoIt's a multi-hundred-thousand line project (current count, excluding tests, is about 210,000). Like any project of a similar size, it has a history of security vulnerabilities. OpenBSD removed it because it was too much code to audit. OpenBSD dodged several issues like this RCE (https://research.checkpoint.com/2019/select-code_execution-from-using-sqlite/ https://research.checkpoint.com/2019/select-code_execution-f...) as a result. See https://www.cvedetails.com/vulnerability-list/vendor_id-9237/Sqlite.html https://www.cvedetails.com/vulnerability-list/vendor_id-9237... Hundreds of thousands of lines of code are simply going to have vulnerabilities and bugs. It's unavoidable with that level of complexity. I'm skeptical anything that complicated is a wise choice for a general file format -- especially when smaller, simpler, and more easily debuggable and independently implementable formats exist.
- mcint 6y agoThe Full Text Search extension (FTS) (FTS4?) has been a repeated source of issues. If you stick with the core, and disable some of the shiny features, the track record is better. Though still not spotless, iirc.