Skip to content

[RESEARCH] Baseline code base against CWE Top 25 #769

Open

Description

@jeffreyaven

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 Lab reports and deduplication

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 postgres RBAC #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

  1. self-assigned this
    on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions