GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(api): conceal cross-tenant resource denials on internal routes by waleedlatif1 · Pull Request #6586 · simstudioai/sim Conversation
Collaborator
Summary
Routes whose status changed (cross-tenant denial only:
|
| Route | Concealed as |
|---|---|
GET/PUT/DELETE /api/workflows/[id] |
Workflow not found |
GET/POST/PATCH/DELETE /api/workflows/[id]/deploy |
Workflow not found |
GET /api/workflows/[id]/deployments |
Workflow not found |
GET/PATCH /api/workflows/[id]/deployments/[version] |
Workflow not found |
PATCH/DELETE /api/workspaces/[id]/files/[fileId] |
File not found |
PUT /api/workspaces/[id]/files/[fileId]/content |
File not found |
GET/PUT /api/workspaces/[id]/files/[fileId]/share |
File not found |
POST /api/table/imports, POST /api/table/[tableId]/exports |
Table not found |
POST/PATCH/DELETE /api/table/[tableId]/groups |
Table not found |
GET/DELETE /api/table/imports/[importId], POST .../parts, POST .../complete |
Table import not found |
GET/DELETE /api/table/exports/[exportId], GET .../download |
Table export not found |
/api/knowledge/[id]/** (read/update/delete/restore, documents, chunks, tags, connectors, uploads, upsert) and POST /api/knowledge/search |
Knowledge base not found |
GET/POST /api/knowledge name no resource, so a 403 there betrays nothing. Concealing them would turn a denied workspace into a phantom empty list./api/mcp/**, /api/skills/**, /api/tools/custom, /api/logs/[id], workflow runs/execute/resume — the v2 routes for these use v2-only use cases with no internal counterpart sharing the symbol, so there is no asymmetry to close. Several of them are also where a flip would regress: hooks/queries/mcp.ts:92,127 and hooks/queries/workflow-mcp-servers.ts:60,130 swallow 404 into [], so a denied user would see a "no servers configured" empty state instead of an error, and deploy-modal/components/mcp/mcp.tsx:400 auto-recreates a tool on 404.GET /api/workspaces/[id]/host-context — untouched. workspace-host-provider.tsx:29 is the one surface that renders a dedicated <WorkspaceAccessDenied /> on 403; flipping it would drop a revoked user into a stale workspace tree.I swept hooks/** and app/** for 403/404 branching on the affected families. Nothing structural flips:
knowledge/[id]/base.tsx:1233 already renders "Knowledge base not found" for both statuses.kb/knowledge.ts:113 rewrites 404 to "Document not found" — message-only change, same error layout.tables/[tableId]/error.tsx copy already hedges "deleted or you may not have permission".error.message verbatim, so a denied write now reads "Table not found" instead of "Insufficient workspace permissions".logs.ts:208 skips retry on 404 — one fewer retry before the same error state.bun run type-check, bunx vitest run app/api lib/api (342 files / 3257 tests), bun run lint, bun run check:api-validation — all green.
Tests pin the concealed status per policy and per route: resource-concealment.test.ts now covers every internal policy alongside the v2 ones, and route-level tests drive the real handlers for file rename/share/content, workflow PUT, and deployment-version PATCH. Table/group route tests assert the wiring. Verified they can fail — stubbing concealCrossTenantResourceError to a passthrough turns 60 tests red, and un-wiring a single table route fails its wiring assertion with expected { kind: 'plain' } to be { kind: 'conceal-import' }.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
PR SummaryHigh Risk Overview Adds Workspace-level list/create and a few intentionally asymmetric surfaces are left unchanged. Reviewed by Cursor Bugbot for commit c96b6b0. Configure here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
f67ef7f to
aa0bba5
Compare
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@cursor review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Greptile SummaryThe PR extends the existing cross-tenant resource-concealment behavior from v2 endpoints to corresponding internal workflow, file, table, and knowledge routes.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/api/server/routes/resource-concealment.ts | Introduces shared internal and raw-handler concealment while preserving the existing v2 classification behavior. |
| apps/sim/lib/workflows/api/route-policies.ts | Applies workflow-not-found concealment to internal single-workflow policies without changing same-workspace denials. |
| apps/sim/lib/knowledge/api/route-policies.ts | Conceals knowledge-base-scoped operations while deliberately retaining existing behavior for workspace-level list and create policies. |
| apps/sim/lib/table/api/route-policies.ts | Adds internal table, group, import, and export concealment policies while retaining the table-lock response branch. |
| apps/sim/lib/workspace-files/api/internal-error-policies.ts | Adds concealment variants for single-file and content operations while preserving specialized file errors. |
| apps/sim/app/api/workflows/[id]/route.ts | Wires declarative and raw workflow handlers through the new concealment behavior. |
| apps/sim/app/api/workflows/[id]/deployments/[version]/route.ts | Conceals cross-tenant failures in the raw deployment-version mutation before existing error classification. |
| apps/sim/app/api/table/table-transfer-routes.test.ts | Verifies all internal table-transfer routes select the appropriate resource-specific concealment policy. |
| apps/sim/lib/api/server/routes/resource-concealment.test.ts | Covers internal and v2 concealment, preserved same-workspace denials, specialized policy branches, and unconcealed list/create behavior. |
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Request[Internal or v2 resource request] --> UseCase[Authorized application use case]
UseCase --> Result{Outcome}
Result -->|Allowed| Success[Existing success response]
Result -->|Cross-tenant denial| Conceal[Resource concealment policy]
Conceal --> NotFound[Domain-specific 404 response]
Result -->|Same-workspace denial| Forbidden[Existing 403 response]
Result -->|Other domain error| BasePolicy[Existing domain error policy]
BasePolicy --> ExistingShape[Existing route-specific error response]
Reviews (3): Last reviewed commit: "fix(api): conceal cross-tenant resource ..." | Re-trigger Greptile
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The v2 routes rewrite DelegatedWorkspaceAuthorizationError, NoWorkspaceAccessError, and WorkspaceApiKeyScopeAuthorizationError to a 404 so a caller with no reach into a workspace cannot confirm a resource exists. The internal routes reach the same application use cases and still answered 403, so the same probe worked from the other surface. Same-workspace role denials stay 403 on both.
aa0bba5 to
c96b6b0
Compare
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@cursor review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c96b6b0. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
c96b6b02
Deployed
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.