high · Reproduction reported
1. A signed-in user can download another team’s export
src/routes/exports.ts:42
- Expected
- Only members of the team that owns an export can download it.
- Observed
- An account in Team Birch received a CSV belonging to Team Maple when it requested Maple’s export ID.
- Safeguards considered
- The route checks that the user is signed in. Shared middleware does not check team membership. Export IDs are hard to guess, but are not an access rule.
- Repeat the test
- Create one export as Team Maple. Sign in as a member of Team Birch and request that export ID. Compare the returned team and file contents.
- Suggested fix
- Look up exports using both the export ID and the current user’s permitted team IDs. Reject requests when no matching export is found.
- Retest
- The owning team should receive its file. Another team and a signed-out request should not. Add both cases to the route tests.
Evidence
Fictional test observations Owner account → GET /exports/export_maple → 200 Other team account → same request → 200 Signed-out request → same request → 401