Repository navigation
Description
Current ownership after the SDK migration
Provider destination and credential dispatch policy belongs in omnisdk #45: stackql-labs/omnisdk#45. StackQL owns operator policy configuration and server integration. The old any-sdk source links below are historical evidence.
Upstream dependencies
Keep this issue open until the relevant upstream changes are available, any required StackQL integration is complete, and the acceptance checks here pass. Upstream issue closure alone is not sufficient.
Constituent of #769. Reviewed current main at 1de4135 on 2026-10-08; this issue proposes work, no implementation is included.
CWEs: CWE-918, CWE-200.
Source: GitHub Security Lab finding 21537, originally tested at adc0956, plus current-code review and the validation below. Credit: GitHub Security Lab Taskflow Agent, GitHub Secure Open Source Fund, reported by @JarLob.
Finding and evidence
internal/anysdk/server.go accepts SQL-bound server-variable values ahead of operator environment values/defaults and does not enforce declared enums. The k8s fixture exposes protocol and cluster_addr in its server URL.
Reproduced against the current build without AUTH: SELECT * FROM k8s.core_v1.nodes WHERE cluster_addr = '127.0.0.1:<collector-port>' AND protocol = 'http' sent the operator's fake bearer token to the loopback collector. This demonstrates credential forwarding to a client-selected destination, independently of the credential-source override finding.
Arbitrary destination selection is useful for self-hosted APIs; the defect is the lack of an operator boundary when less-trusted server clients choose that destination. This review did not access metadata services, private networks or real cloud credentials.
Required outcome
- Add operator policy for which server variables clients may override and which credential-bearing destinations/schemes are permitted. Preserve explicitly configured private/self-hosted endpoints.
- Enforce OpenAPI server-variable enums and make operator-pinned endpoints non-overridable when that policy is selected.
- Apply destination checks to the actual request, including redirects and DNS resolution where an IP policy is used. Define how unstable omnisdk providers fit the same server policy.
- Put provider URL/auth transport semantics in omnisdk; expose and document configuration in stackql.
Validation and acceptance
Use loopback HTTP/HTTPS mocks and dummy credentials. Verify rejected host/scheme/enum overrides cause no request or credential disclosure; operator-allowed endpoints still work. Cover SQL, pgwire, MCP, redirects, IPv6 and hostname resolution. Add regression coverage for env-pinned endpoint precedence.
Scope and related work
Not fixed by mTLS, read_only SQL, or restricting AUTH. General outbound API access is intentional; do not blanket-ban RFC1918 addresses without an operator-controlled exception.
Activity