sqlite-mutating-sql
SQLite: mutating SQL blocked
The sections below are generated from the CLI (methodology 0.3-draft, CLI 0.3.0); the same text is printed by sealmark explain sqlite-mutating-sql.
- pack
sqlite- weight
- critical
- scope
- server (tested through its SQL tool against a seeded SQLite file; the engine itself is not what is graded; SQLite only in this release, DuckDB is planned)
- decided by
- db-state
- since
- 0.2-draft (methodology 0.3-draft)
- config keys
checks.sqlite-mutating-sql.corpus.addchecks.sqlite-mutating-sql.corpus.removechecks.sqlite-mutating-sql.enabledchecks.sqlite-mutating-sql.severity
Probes
stacked-insertSELECT 1; INSERT INTO probe_t (id, v) VALUES (9002, 'stacked') corecomment-obfuscation/*x*/ iNsErT INTO probe_t (id, v) VALUES (9003, 'obf') corecte-insertWITH x AS (SELECT 1) INSERT INTO probe_t SELECT 9004, 'cte' FROM x corereplace-intoREPLACE INTO probe_t (id, v) VALUES (9005, 'replace')upsertINSERT INTO probe_t (id, v) VALUES (9006, 'upsert') ON CONFLICT (id) DO UPDATE SET v = 'x'create-tableCREATE TABLE sm_ddl (x int)alter-tableALTER TABLE probe_t ADD COLUMN sm intdrop-tableDROP TABLE audit_probepragma-user-versionPRAGMA user_version = 7pragma-journal-modePRAGMA journal_mode = wal
core marks the canonical probes of the check; the others are extra coverage. How they decide the verdict is stated under How the verdict is established.
Settings and thresholds
Every check also takes checks.sqlite-mutating-sql.enabled and checks.sqlite-mutating-sql.severity; they are described once in the configuration reference.
This check has no numeric threshold.
| Key | Default | Standard | Meaning |
|---|---|---|---|
checks.sqlite-mutating-sql.corpus.add | [] | locked | Extra probes for sqlite-mutating-sql, validated against the pack's corpus schema. Appends across layers. Any addition makes the run CUSTOM. |
checks.sqlite-mutating-sql.corpus.remove | [] | locked | Probe ids or exact strings to drop from the sqlite-mutating-sql corpus. Appends across layers. Any removal makes the run CUSTOM. |
How the verdict is established
- Scoring. critical and scored: pass = 1 point, part = 0.5, fail = 0. A fail caps the pack's grade at D, whatever the other checks scored.
What to fix
Parse the statement instead of prefix-matching; reject stacked statements, writes inside CTEs, PRAGMA changes and comment-obfuscated forms, and open the connection read-only.
False positives
A server that deliberately offers a second tool for writes is judged on the read tool only; a write-capable tool declared as a writer is listed under not covered. PRAGMA writable_schema = 1 is excluded because it changes nothing without a following write.
False negatives
Only the statement forms in the published corpus are tried; a server that blocks those and allows another form still passes. The engine's own configuration (compile options, authorizer) is not inspected.