Develop - #204
Merged
Merged
Conversation
…ence paths Closes six cross-tenant (group) isolation gaps found in the develop-branch authorization audit. Each affected endpoint was reachable by an API key (or a JWT member of another group) and either loaded/mutated a resource by its own global id, or accepted a reference to another entity, without verifying the owning group. All fixes treat a foreign-group reference as not-found so resource existence is not leaked across groups. - Workflow config IDOR (upload): WorkflowService.resolveWorkflowVersionId and getModelIdDefault now scope WorkflowVersion/Lineage lookups to the caller's group via the owning lineage, so a foreign workflow config cannot be resolved, executed, or disclosed at document upload. - Benchmark definition references: createDefinition/updateDefinition require the datasetVersionId and workflowVersionId to belong to the project's group; startRun requires candidateWorkflowVersionId's lineage to be in the project's group - preventing pinning/executing another group's dataset/workflow and exfiltrating ground truth. - Benchmark candidate writes: applyToBaseWorkflow/promoteCandidateWorkflow verify the candidate AND the base lineage being written into belong to the project's group, preventing writes into another group's workflow lineage. - Confusion profiles: findById/update/delete are scoped by group_id so path-group membership no longer grants access to another group's profile by id. - Template-model children: field update/delete and label delete are scoped to the owning template model (and labeling document), closing child-row IDOR. - GET /api/models: trained-model listing is filtered to the caller's groups via getIdentityGroupIds; prebuilt models remain global. Adds/updates unit tests (including explicit cross-group negative cases) for every change and documents the pattern in docs-md/GROUP_RESOURCE_AUTHORIZATION.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fix(security): enforce cross-group isolation on resource-id and reference paths
Opt-in, per-workflow ephemeral policy. When a workflow declares
metadata.ephemeral, documents it processes are purged once they reach a
terminal status — blob files and/or the Temporal execution record are
deleted per the policy — while the OCR result in Postgres is retained.
- metadata.ephemeral: true | { files, temporalRecord } for per-target control
- EphemeralDocumentCleanupService: @Cron(EVERY_MINUTE) janitor, gated solely
by workflow config (no global flag, no per-group setting)
- TemporalClientService.deleteWorkflowExecution (idempotent on NOT_FOUND)
- documents.purged_at marker + partial index documents_purge_scan_idx
(WHERE purged_at IS NULL) to keep the janitor scan cheap at high volume
- docs-md/ephemeral-document-cleanup.md
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
feat: ephemeral-document cleanup (per-workflow blob + Temporal purge)
alex-struk
requested review from
NoorChasib,
antsand,
dbarkowsky and
kmandryk
as code owners
June 24, 2026 18:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AI-###
Changes
Testing
Checklist
By submitting this pull request, I acknowledge that I have attempted to meet the following: