Repository navigation
fix(security): harden saved-credential, proxy egress, and keyless-mint paths from the release audit - #9865
Conversation
…p paths from the release audit - Refuse session callers resolving saved service-account secrets on POST /api/auth/oauth/token - Refuse a proxied hostname when any resolved record is blocked (the proxy re-resolves) - Apply the response cap to every body, not only decoded ones (undici's http proxy wrapper ignores maxResponseSize) - Bind workload-identity subjects to their owner at mint time - Bound Databricks token/identity JSON reads; refuse single-slash https:/ in typed URLs; case-insensitive Dynatrace /api/vN strip - Twilio recordings: stay on the Twilio API origin and bound fetch concurrency - Firecrawl: count crawl maxDepth below the start URL; stop sending unused search sources - sim-setup reset refuses when Docker is installed but unreachable - Remove the dead requireDeployment branch from workflow access middleware; reuse requireMutableWorkflow; move a misplaced TSDoc - Docs: CONTRIBUTING setup via sim-setup, sim-setup README, Helm read-only-root mounts, proxy and NO_PROXY behavior, GitLab CSV body limit
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
[High impact] The PR appears safe to merge; no new actionable issues were found. SummaryThis PR tightens saved-secret access, proxy destination checks, workload-identity subjects, and Twilio recordings requests.
Reviews (3) · Last reviewed commit: "fix(security): stop queued Twilio record..." · Reviewed by Greptile |
There was a problem hiding this comment.
1 issue found across 39 files
Confidence score: 3/5
lifecycle.tscan archive environment files when Docker is unavailable, leaving volumes behind with unusable credentials. Block reset whenever Docker is unreachable.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/sim-setup/src/lifecycle.ts">
<violation number="1" location="packages/sim-setup/src/lifecycle.ts:597">
P2: This guard still archives environment files when the Docker CLI is absent, because `executableExists('docker')` is false; block reset whenever Docker is unreachable so volumes cannot be left behind with unusable credentials.</violation>
</file>
Drops the response cap and crawl depth (landed in #9860), CONTRIBUTING (#9860), Firecrawl search sources (on hold), Databricks JSON caps (#9859), and the workflow middleware and route-policies cleanups (#9858). Drops the NO_PROXY entry-syntax docs line (owned by a separate NO_PROXY change). Generated files regenerated on current staging.
|
Release-audit coordination note for this PR's owner (from the session that owns #9864, which dropped its networking.mdx edits in favor of this PR): Please consider adding one sentence to "Proxying guarded requests" in |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 24 files
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
Turn on auto-fix | Re-trigger cubic
…token-route auth mocks, bump chart - Twilio list calls takes the run's signal: queued recordings requests stop once it aborts, and fetch receives it - Token route tests type the hybrid-auth mock through the real AuthResult and pass a route context - Chart version 1.11.13 for the README and helper comment changes
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
Verified fixes from the audit of the current staging→main release, scoped to the items this PR owns.
Security
POST /api/auth/oauth/tokenrefuses session callers resolving a saved service-account credential (403SERVICE_ACCOUNT_SESSION_FORBIDDEN). Saved secrets resolve only in-process (internal JWT). OAuth, managed OAuth, and internal-JWT callers are unchanged; the only callers are the route andresolveExecutorCredentialToken(alwaysINTERNAL_JWT)HTTP(S)_PROXY: a hostname is refused when any resolved record is blocked (requireEveryAddress), since the proxy re-resolves and may dial the blocked one. IP literals andNO_PROXYhosts are unchangedmintWorkloadIdentityTokenrefuses a subject that does not belong to the minting owner (assertWorkloadIdentitySubjectOwner), covering AWS and Databricks in one placehttps://api.twilio.com(saved Basic auth rides along); per-call recordings fetches are bounded to 10 in flightrefuseUnsafeTypedUrlrefuses the single-slashhttps:/hostform, likenormalizeHttpBaseUrl; Dynatrace/api/v1|v2suffix strips are case-insensitiveCorrectness
sim-setup resetrefuses when Docker is installed but unreachable, instead of archiving env files while the volumes surviveCleanups
deployments.tsuses the sharedrequireMutableWorkflowDocs
resetorderemptyDirmounts for read-only root (/tmp,.next/cache,.next/server/route-cache)describenames the 10 MiB request body limit (OpenAPI regenerated)The crawl-depth and proxied response-cap fixes (and the CONTRIBUTING update) landed in #9860. #9859 owns the Databricks response caps, #9858 the workflow middleware and route-policies cleanups, and #9862 Firecrawl search.
Type of Change
Testing
Each security regression test was run against the code with its guard removed and failed, then passed with the guard restored:
app/api/auth/oauth/token/route.test.ts: a session caller with a service-account credential gets 403 and no secret; internal-JWT resolution and session OAuth still return tokenslib/core/network/environment-proxy.server.test.ts: a name resolving to93.184.216.34+169.254.169.254is refused with zero proxy tunnels, while all-public records still tunnellib/credentials/workload-identity/issuer.test.ts: minting for another workspace, an organization, or a lookalike id (ws-10) throwslib/credentials/token-service-accounts/validators/http.test.ts:refuseUnsafeTypedUrl('https:/evil.com')throwstools/twilio_voice/list_calls.test.ts:@evil.test/xand absolute off-origin paths never fetch off Twilio; concurrency peaks at 10packages/sim-setup/src/lifecycle.test.ts: with Docker unreachable,resetrejects and leaves the env file unarchivedAlso ran the other touched test files (268 tests),
bun run lint,check:source-conventions,check:comment-hygiene,check:test-patterns,check:utils,check:api-validation:strict,check:boundaries,check:explicit-any(baseline regenerated),check:openapi,check:cli-api,check:mcp-operations,check:cli-docs,check:v2-route-table,check:docs,check:tool-metadata, and the pre-push type-check.Checklist
test-auditauthoring gate)