Deny SQLite statistics table access through a default hook

This commit is contained in:
Simon Willison 2026-09-09 12:27:11 -07:00
commit d334539a1e
5 changed files with 152 additions and 4 deletions

View file

@ -894,10 +894,7 @@ async def test_hidden_sqlite_stat1_table():
await db.execute_write("analyze")
data = (await ds.client.get("/db.json?_show_hidden=1")).json()
tables = [(t["name"], t["hidden"]) for t in data["tables"]]
assert tables in (
[("normal", False), ("sqlite_stat1", True)],
[("normal", False), ("sqlite_stat1", True), ("sqlite_stat4", True)],
)
assert tables == [("normal", False)]
@pytest.mark.asyncio