You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
engine: sandboxed public query — flatsql_query_sandboxed (SDN gateway loop G.5)
One read-only SELECT for UNTRUSTED callers, enforced in-engine:
- sqlite3_set_authorizer during prepare: only SELECT / functions /
recursive CTEs / reads of record vtabs + shadow tables + unified views;
PRAGMA, ATTACH/DETACH, all DDL/DML (incl. temp), TRANSACTION/SAVEPOINT
and reads of control tables or sqlite_* reserved names are denied.
CTE/subquery aliases are recognized against a schema enumeration that
FAILS CLOSED.
- single-statement (non-whitespace prepare tail rejected),
sqlite3_stmt_readonly + result-column checks.
- statement timeout via sqlite3_progress_handler (steady-clock deadline;
SQLITE_OMIT_PROGRESS_CALLBACK removed from the wasm builds — with no
handler installed the VDBE overhead is a compare per jump op).
- row/byte caps enforced in the step loop: oversized results REJECT,
never truncate.
- two output modes through the response-artifact readout: record stream
(all-BLOB cells -> aligned size-prefixed frames, byte-parity with
queryRawFlatBufferStream) and JSON rows (bare array, column names
verbatim from SQLite — schema-exact key capitalization by
construction; blobs base64, NaN/Inf -> null).
- bypasses statement/query/raw-stream caches entirely; no-throw on both
builds (errors latch with a stable 'sandbox: <code>: ...' prefix).
JS wrappers querySandboxed() on both hosts (emscripten index.js +
standalone.js) with .d.ts; jest suite test/sandbox-query.test.ts covers
the injection/abuse matrix on both hosts (150/150 green). v1.2.0.
Co-Authored-By: Claude Fable 5 <[email protected]>
0 commit comments