sqlite-utils/sqlite_utils
Bunlong Heng 2d3c6b9a1e
Escape tokenize argument in enable_fts (#828)
The tokenize value passed to Table.enable_fts() was interpolated directly
into the CREATE VIRTUAL TABLE statement inside a single-quoted string
literal. A value containing a single quote could break out of that literal
and inject arbitrary SQL, which executes via executescript(). This is
reachable from the CLI via 'enable-fts --tokenize'.

Route the value through the existing Database.quote() helper so SQLite
itself escapes it. Legitimate tokenizers such as 'porter' are unaffected.
Adds a regression test.
2026-08-11 22:48:06 -07:00
..
__init__.py Fixes for Ruff>=0.16.0 (#814) 2026-07-25 14:53:12 -07:00
__main__.py Support 'python -m sqlite_utils', closes #368 2022-01-08 18:33:22 -08:00
cli.py Fixes for Ruff>=0.16.0 (#814) 2026-07-25 14:53:12 -07:00
create_table_parser.py Preserve column before/after comments through .transform() 2026-08-11 22:45:00 -07:00
db.py Escape tokenize argument in enable_fts (#828) 2026-08-11 22:48:06 -07:00
hookspecs.py Fixes for Ruff>=0.16.0 (#814) 2026-07-25 14:53:12 -07:00
migrations.py Fixes for Ruff>=0.16.0 (#814) 2026-07-25 14:53:12 -07:00
plugins.py Fixes for Ruff>=0.16.0 (#814) 2026-07-25 14:53:12 -07:00
py.typed py.typed file so mypy picks up the types, closes #331 2021-11-14 15:21:04 -08:00
recipes.py Fixes for Ruff>=0.16.0 (#814) 2026-07-25 14:53:12 -07:00
utils.py Fixes for Ruff>=0.16.0 (#814) 2026-07-25 14:53:12 -07:00