Repository navigation
Description
Current ownership after the SDK migration
The baseline below records an earlier dependency snapshot. Current provider execution uses omnisdk; current registry/archive and SQL-function ownership is in StackQL. Follow each current child issue's upstream dependencies and acceptance criteria. Do not treat archived any-sdk tickets as active implementation prerequisites.
Research and baseline code base against CWE Top 25
Decomposition - 2026-10-08
Reviewed main at 1de4135faaa604ad055f2bb1ebf25b496d6e6feb and the pinned dependencies: any-sdk v0.6.0-alpha01, psql-wire v0.1.3-beta01, stackql-parser v0.0.16-alpha02, MCP Go SDK v1.8.0 and omnisdk v0.1.3-beta03. Reconciled the local CWE baseline/drafts and Security Lab findings 21530, 21536 and 21537. No implementation changes were made.
21 distinct work items are below. Issues separate reproduced defects from source-confirmed hardening, include code references and acceptance tests, and identify cross-repository ownership where needed. Labels indicate bug versus enhancement; they are not CVSS scores. This tracker remains open for the work.
Constituent issues
- [SECURITY] Make unauthenticated pgwire exposure an explicit operator choice #814 - Make unauthenticated pgwire exposure an explicit operator choice
- [SECURITY] Require operator opt-in for NATIVEQUERY on server surfaces #815 - Require operator opt-in for NATIVEQUERY on server surfaces
- [SECURITY] Restrict client-selected credential sources and prevent failed AUTH from changing shared credentials #816 - Restrict client-selected credential sources and prevent failed AUTH from changing shared credentials
- [SECURITY] Constrain client-selected provider destinations before attaching operator credentials #817 - Constrain client-selected provider destinations before attaching operator credentials
- [SECURITY] Classify SQL by its effects before applying MCP safety modes #818 - Classify SQL by its effects before applying MCP safety modes
- [SECURITY] Validate registry identifiers and contain cache deletion within the registry root #819 - Validate registry identifiers and contain cache deletion within the registry root
- [SECURITY] Contain and bound provider archive extraction #820 - Contain and bound provider archive extraction
- [SECURITY] Use backend-correct quoting for generated SQL literals and identifiers #821 - Use backend-correct quoting for generated SQL literals and identifiers
- [SECURITY] Bind request encodings in analytics cache freshness queries #822 - Bind request encodings in analytics cache freshness queries
- [SECURITY] Prevent user DDL from dropping StackQL control and unmanaged tables #823 - Prevent user DDL from dropping StackQL control and unmanaged tables
- [SECURITY] Fail startup when MCP security configuration cannot be parsed #824 - Fail startup when MCP security configuration cannot be parsed
- [SECURITY] Stop logging secret-bearing process arguments at MCP startup #825 - Stop logging secret-bearing process arguments at MCP startup
- [SECURITY] Honor strict MCP audit failure modes in tool responses #826 - Honor strict MCP audit failure modes in tool responses
- [SECURITY] Bind MCP approval retries to the original action and document client trust #827 - Bind MCP approval retries to the original action and document client trust
- [SECURITY] Enforce MCP request limits and HTTP timeouts #828 - Enforce MCP request limits and HTTP timeouts
- [SECURITY] Bound pgwire connections, statement lifetime and debug retention #829 - Bound pgwire connections, statement lifetime and debug retention
- [SECURITY] Contain server request panics at the goroutine that executes the request #830 - Contain server request panics at the goroutine that executes the request
- [SECURITY] Bound provider and registry response reads #831 - Bound provider and registry response reads
- [SECURITY] Define and enforce registry content verification before installation and execution #832 - Define and enforce registry content verification before installation and execution
- [SECURITY] Run the production container as a non-root user #833 - Run the production container as a non-root user
- [SECURITY] Keep preview IaC state paths under operator control on server surfaces #834 - Keep preview IaC state paths under operator control on server surfaces
Security Lab reports and deduplication
- 21530: [SECURITY] Make unauthenticated pgwire exposure an explicit operator choice #814, [SECURITY] Run the production container as a non-root user #833. The listener and container privilege concerns have independent fixes; user/role authorization stays in Implement
postgresRBAC #312. - 21536: [SECURITY] Require operator opt-in for NATIVEQUERY on server surfaces #815. Its anonymous reachability shares [SECURITY] Make unauthenticated pgwire exposure an explicit operator choice #814; it is not an additional authentication issue. SQLite code execution was not demonstrated; PostgreSQL command execution depends on a privileged backend role.
- 21537: [SECURITY] Restrict client-selected credential sources and prevent failed AUTH from changing shared credentials #816, [SECURITY] Constrain client-selected provider destinations before attaching operator credentials #817. Credential-source mutation/failed AUTH/shared state are grouped in one issue. Destination control is independent because a SELECT can forward the already configured token without AUTH. Client-facing credential/path errors belong with source control.
- Retain existing Implement
postgresRBAC #312 (RBAC, shared administrative state and view ownership), [BUG] PURGE empties or drops materialized views and user space tables #799 (PURGE destroys user data), [BUG] March and June Quarters: Fix known nil reference paths #633 (concrete nil-reference fixes), [FEATURE] Fuzz the pgwire and MCP server interfaces as part of build CI #803 (protocol fuzzing), [FEATURE] add redacted request header tohttp.log.enabledoutput #359 (redacted request-header diagnostics), and CI logs expose S3 object listing metadata #606 (CI log exposure). These were not refiled. - [Feature] Add configurable server behaviour to implement desired TLS beaviour. #366 is related TLS configurability, not the unauthenticated default. [Bugfix]
psql -conly supports one statement #396 is multi-statement pgwire correctness, not a new security finding. Security fixes #506 describes a historical mock HTTP path issue, distinct from production registry deletion/extraction.
Baseline disposition
| CWE(s) | Disposition |
|---|---|
| 89 | Generated SQL and cache query boundaries: #821, #822. Native SQL is an exposed capability, not mislabeled SQL injection. |
| 862, 863, 284 | #816, #818, #823, #827; broader role/ownership policy remains #312. |
| 22 | Registry deletion/extraction and opt-in preview state: #819, #820, #834. |
| 476 | Request panic containment: #830; root causes/fuzzing remain #633/#803. |
| 20 | Configuration and registry input handling: #824, #819. |
| 200 | Credential source/destination control and runtime argument logging: #816, #817, #825. |
| 306 | Listener authentication/default exposure: #814. |
| 918 | Credential-bearing destination policy: #817. |
| 770 | Archive, MCP, pgwire and upstream-response limits: #820, #828, #829, #831. |
| 352 | PR #804 introduced cross-origin protection and required HTTP bearer authentication or explicit opt-in; no duplicate filed. |
| 79, 434 | No applicable HTML-rendering or unrestricted-upload defect identified in the reviewed server surfaces. |
| 78, 77, 94 | No separate command/code-injection exploit established. Provider-authored local_templated execution and CLI jsonnet imports are trust boundaries; provider content verification is #832. argv execution alone is not evidence of shell injection. |
| 502 | No unsafe object-deserialization finding established in reviewed typed decoders. Response/expansion limits are tracked separately. |
| 787, 416, 125, 120, 121, 122 | No first-party memory-corruption finding identified. Pure-Go builds do not prove every dependency/runtime is immune; no unsupported blanket safety claim. |
| 639 | No tenant-key authorization bypass established. Unbound MCP approval retry hardening is #827, with an explicit cooperating-client limitation. |
| Outside Top 25 | Exposed native capability #815; credential path/session exposure #816; registry integrity #832; runtime logs #825; container privilege #833; strict audit failure handling #826. |
Corrected or non-actionable claims
- MCP pull_provider and reload_credentials are explicitly documented as permitted in every mode. Their presence in read_only is not itself a bypass. Unsafe cache paths, trust and credential-source changes have separate issues.
- Existing multi-statement gating, one-statement validation and hierarchy guards from security-hardening #804 were retained, not refiled. Nested EXEC/effectful SELECT is a different path.
- Current registry parser accepts double-quoted traversal identifiers; the draft backtick examples did not parse. The issue uses verified syntax.
- QueryMaterializedView has no callers in this checkout; no remotely reachable exploit is claimed through it. SQL renderer cleanup can remove/harden it.
- Credential reload returns source paths/variable names by documented contract; no secret value exposure was demonstrated through that reporting alone.
- Shared views and broad administrative rights need an explicit server privilege model (Implement
postgresRBAC #312), not an invented existing tenant-isolation guarantee. - SQLite load_extension was denied. Newline-containing credential values are blocked by HTTP header validation on the reported token channel. These limits are preserved in the issue descriptions.
Validation performed
- Built the current checkout with CGO_ENABLED=0 on Windows using Go 1.26.6.
- Isolated loopback pgwire probes confirmed anonymous access, native backing-store writes/file creation, cross-connection state visibility, internal control-table deletion, failed AUTH credential changes, and forwarding of fake credentials to a client-selected local collector.
- A local provider response containing an apostrophe reproduced the generated-SQL filter failure. A formatter/SQLite probe demonstrated expression injection at that boundary; a focused cache test demonstrated selection of another request encoding.
- Disposable archive/cache probes confirmed outside-root writes/deletion. A valid preview fixture created ledger/journal state outside approot before a Windows directory-sync error; no provider mutation occurred in that probe.
- Five in-memory MCP probes confirmed nested EXEC dispatch, unsolicited approval acceptance, unenforced limits, strict audit success-on-failure, and invalid-config fallback. A startup probe confirmed a dummy password in stderr.
- Existing targeted Go tests passed for pkg/mcp_server/... (including policy/audit/render), pkg/sqlsplit, internal/stackql/queryshape, internal/stackql/paramdecoder and pkg/astformat. Test overlays and scripts were kept under ignored tmp/security_issues; no tracked source/test files were edited.
- No full robot suite, production image rebuild, live cloud calls, resource-exhaustion attack or new PostgreSQL backend reproduction was performed. Source-only findings and previous lab results are explicitly marked in their issues.
Security Lab credit is retained on the report-derived issues: GitHub Security Lab Taskflow Agent, GitHub Secure Open Source Fund and @JarLob.
Activity