Repository navigation
Commit 5a69583
fix(analyst): deny PostgreSQL control, large-object, dblink and checkpoint function classes structurally in read-only
The function denylist grew one name per review round (`pg_log_standby_snapshot`, `lo_import_with_oid`, `lo_creat`, DuckDB `checkpoint`/`force_checkpoint` were the latest escapes). It is replaced by a structural rule: every `pg_*` call is refused unless it is a known pure read (type/size/catalog inspection, `pg_get_*`, stat getters other than `pg_stat_reset*`, LSN and snapshot reads, privilege checks); every `lo_*`, `lowrite`/`loread`, `dblink*`, `checkpoint`/`force_checkpoint`, sequence, config and file-write call is refused. A future server-control function is therefore denied by default.
tests: class-denied cases (lo_import_with_oid, lo_creat, pg_log_standby_snapshot, pg_read_file, pg_sleep, checkpoint, force_checkpoint, an invented future pg_ function) rejected before execution in predicates and populations; eight pure reads (pg_typeof, pg_size_pretty, pg_column_size, pg_get_expr, pg_stat_get_numscans, pg_relation_size, pg_current_wal_lsn, pg_has_role) still execute; all earlier denylist and literal/comment/identifier cases unchanged.
Co-Authored-By: Claude Fable 5.1 <[email protected]>sql_check sources1 parent c9cfe17 commit 5a69583
2 files changed
Lines changed: 57 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
9 | 30 | | |
10 | 31 | | |
11 | 32 | | |
| |||
187 | 208 | | |
188 | 209 | | |
189 | 210 | | |
190 | | - | |
| 211 | + | |
191 | 212 | | |
192 | 213 | | |
193 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
144 | 157 | | |
145 | 158 | | |
146 | 159 | | |
| |||
188 | 201 | | |
189 | 202 | | |
190 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
191 | 226 | | |
192 | 227 | | |
193 | 228 | | |
| |||
0 commit comments