Load SQLite extensions via SQLite C-API#319
Load SQLite extensions via SQLite C-API#319Andy-2639 wants to merge 7 commits intoxerial:masterfrom Andy-2639:master
Conversation
|
Is there a way forward on this PR? |
|
I am interested in this as well. What is the way forward? |
|
I found it's relatively easy to do without this change:
Note the shared library extension must be omitted. P. S. I've compiled md5 from this source https://github.com/moisseev/sqlite-md5/blob/master/md5.c on macOS using clang CLI: |
Yes, it is. It just allows extensions - arbitrary code - to be loaded into your process by normal SQL queries or SQL injection attacks. |
|
@Andy-2639 cool, I see you point. I'd say those parts of a program calling load_extension stuff shouldn't be exposed to a non-authorised user's input data. And adding more native calls perhaps enlarges the attacking surface by itself. can it be used to disable the feature once all required extensions are loaded? Although it might be added after your PR. |
|
@alun Yeah, should work. However, I don't see it exposed. So I guess when exposes enable_load_extension andSQLiteConnection
Edit: Changing the return type is not an option because it breaks API compatibility: https://wiki.eclipse.org/Evolving_Java-based_APIs_2#Evolving_API_interfaces_-_API_methods |
|
I sketched a possible solution to disable extension loading after loading them with the |
|
@Andy-2639 given this is 4 years old, it needs to be updated to the latest version. If you can do that i can review the code, i think it would be a good addition to this project. |
|
Sorry @gotson, as this PR needs the native libs rebuilt and I currently have no Linux system available to do this, caring about this PR takes too much time for me. I'm fine with the workaround described in #317 (comment) despite the nasty downcast. |
Almost everything is built via Dockcross now, should work well on WSL on Windows too. I will mark this as needing rework, if someone wants to pickup your work |

This allows to load SQLite extensions without enabling the SQL function load_extension.