Export Scope Verification
Confirm that export, report and download features only ever contain the requesting account's own data
Use when: the product offers CSV, JSON or PDF export, scheduled reports or data downloads
Avoid when: no export mechanism exists and responses are limited to interactive views
Procedure
- Locate every export path: interactive download, scheduled report, share link and asynchronous job.
- Populate both test accounts with distinctly labeled rows so any crossover is unmistakable in the output.
- Run an export as each account and diff the outputs against the labeled fixtures.
- Check parameters such as date range, filter and tenant hints, which sometimes widen the query beyond the caller's scope.
- Inspect shared or public export links for token strength and whether they can be revoked.
- Record which query applies the ownership filter, since the fix usually belongs there rather than in the download handler.
Signals
- An export contains rows labeled for the other test account.
- A filter parameter expands the date range and reveals records the interactive view never shows.
- A share link returns data without any credential, using only a guessable token.
- A scheduled report delivers to a recipient whose scope changed since the schedule was created.
Patterns
1. Fixture diff
alice export: rows 1-40 (labels ALICE-*), bob export: rows 1-55
extra 15 rows contain BOB-* or unowned records -> finding
2. Parameter review
params: from, to, scope=workspace, includeArchived=true
-> includeArchived widens result beyond the interactive query
3. Result row
path=/api/export/csv account=alice rows=40 foreign=0 scope_filter=applied
Pitfalls
- Testing exports with empty accounts, where nothing exists to leak and the test proves nothing.
- Only using the interactive download while ignoring scheduled or shared variants with different code paths.
- Reporting the download handler as the problem when the missing filter lives in the underlying query.
Done when
- Every export path has been run for both test accounts and the outputs diffed against labeled fixtures.
- Scope-widening parameters and share-link controls are documented alongside the query that applies ownership.