fix(daemon): harden provider endpoints and document credential aggregation (A1/A3)#82
fix(daemon): harden provider endpoints and document credential aggregation (A1/A3)#82sudhirverma wants to merge 4 commits into
Conversation
…ation (A1/A3) Validate provider base_url and known engines on configure/config writes, audit secret and endpoint changes, and record DR-038 for deferred encryption-at-rest.
Update engines.js vitest mocks so UpdateConfig can call validateConfigProviderEngines after the A1/A3 hardening.
Maintainer assist — agent-executable follow-upContext: Closes AAP-82836 (findings A1 / A3 under epic AAP-80944): document credential-aggregation blast radius + audits, and block malicious/writable provider endpoints via engine allowlist + How to use this comment: Execute items in order. P0 is merge-blocking. Do not invent extra scope. Prefer fixing on branch P0-1 — Resolve DR-038 three-way collisionProblem: On current
Why it matters: Duplicate DR numbers break the decision log. Reviewers cannot cite “DR-038” unambiguously; merges will fight over What to do:
Acceptance:
P0-2 — Honor
|
cidrblock
left a comment
There was a problem hiding this comment.
Verdict: needs work before merge.
Solid A1/A3 implementation and tests; CI green and up to date with main. Merge-blocked on:
- DR-038 collision with #81 and #83 (three different decisions all claim DR-038) — renumber after coordinating merge order.
CoreState.addProviderignoresserver.allowed_provider_hosts— enterprise allowlist bypass on the in-memory path.
Full agent-executable brief is in the PR comment above.
Renumber A1/A3 from colliding DR-038 to DR-039, apply server.allowed_provider_hosts on CoreState.addProvider with audits, and document residual https default risk. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed the maintainer-assist follow-up on Choices
Commit
Confirmation
|
Keep #83 MCP self-connection as DR-039; renumber A1/A3 provider endpoint policy to DR-040 after the merge collision.
Summary
Closes AAP-82836 (findings A1 / A3): credential aggregation blast radius and malicious/writable provider endpoint risk for Enterprise, Security-Conscious, and air-gapped operators.
Depends on auth + config-write hardening already on main (AAP-82788, AAP-82832, AAP-82833 / DR-030, DR-036, DR-037).
Finding A1 — Credential aggregation
docs/CONFIGURATION.md.hasValue) only.[Audit] secret changedon set/delete (never log values).Finding A3 — Provider supply chain + malicious endpoints
@ai-sdk/*packages remain a fixed in-code allowlist (PROVIDER_LOADERS); unknownenginerejected on configure / config write.base_url(http/https only, no URL userinfo, http limited to loopback unless allowlisted /allow_insecure_provider_http).server.allowed_provider_hostsfor enterprise/air-gapped gateways (also enforced onCoreState.addProvider).[Audit] provider endpoint changedon successful endpoint updates.Code / tests
provider-endpointpolicy helpers + unit tests.POST /api/config/ discover-models and gRPCConfigureProvider/UpdateConfig/DiscoverModels.CoreState.addProviderhonorsserver.allowed_provider_hosts+ audits (core-add).tests/integration/provider-endpoint-security.test.ts(unauth denied, bad endpoint rejected, allowed endpoint audited, unknown engine rejected).Test plan
npm test—provider-endpoint/secrets-audit/config-schema/provider-endpoint-security/state-add-providernpm run lintnpm test(full suite)npm run ci:buildPOST /api/provider/:id/configure→ 401http://evil.example/...→ 400https://…or loopback http → 200 and[Audit] provider endpoint changedin logsissue: https://redhat.atlassian.net/browse/AAP-82836