nalgeon / sqlean

The ultimate set of SQLite extensions
MIT License
3.72k stars 118 forks source link

escape quotes in undefine impl #125

Closed sivukhin closed 2 months ago

sivukhin commented 2 months ago

Context

undefine do not escape function name parameter (just use plain %s format specifier) which can lead to SQL injection if non-trusted user can create custom functions like this: select define('f ''; drop table innocent; --', '1');

sqlean must use dedicated %q and %w specifiers which automatically duplicate single(')/double quote(") in order to avoid such issues.

nalgeon commented 2 months ago

Thank you!