Skip to main content
Next Defence - Next-Gen AI Cyber Security Firm
Australia & New Zealand[email protected](02) 9064 2614
INSIGHT

Tenant Isolation for SaaS Bulk Export APIs: The Authorisation Gap

A SaaS platform lets authenticated customers schedule asynchronous exports for audit reporting. The user interface shows only the customer's own organisation, but the API accepts a tenant identifier in the request payload.

The tenant field is not an authority to export

A SaaS platform lets authenticated customers schedule asynchronous exports for audit reporting. The user interface shows only the customer’s own organisation, but the API accepts a tenant identifier in the request payload. If the background worker treats that field as authoritative, a valid account can potentially request another customer’s documents without ever breaking authentication. The problem is a missing authorisation decision at the job boundary, not an insufficient password policy. Test it with two synthetic tenants and controlled data; real customer exports should never be used as proof-of-concept material without explicit authority.

Draw the complete job flow: browser request, export job creation, message queue, worker credential, database query, object storage, presigned download URL and notification. Mark where the tenant context is obtained and where it is verified. A frontend filter can help usability but cannot enforce isolation when a caller can send direct requests. The backend must derive the authorised tenant set from trusted session and membership records, or from a server-validated delegation, and must check the specific requested resource against it.

Bind authority to the entire job lifecycle

A common mistake is checking authorisation only at scheduling time. A queued task may execute later, after a user’s membership was revoked or a tenant relationship changed. Choose a documented policy for revocation: either revalidate at execution and delivery, or use a short-lived signed authorisation snapshot with tightly bounded scope and explicit lifecycle rules. Whatever the model, the job must not gain access from a tenant ID supplied inside untrusted JSON. The worker’s powerful service identity should not convert the caller’s limited request into unrestricted data access.

Scope the export token to a single job, tenant and object set, with expiry and protection against reuse where supported. A completion email should not leak the object through a permanent public URL. If the worker publishes an archive to object storage, verify bucket policy, metadata visibility, access logging and eventual deletion. Include export cancellation and partial failure: a failed archive builder may leave intermediate files and debugging traces that bypass the normal customer download route.

Test object-level and function-level controls

Create tenant Alpha and tenant Beta with deliberately distinguishable synthetic records. Alpha’s authorised analyst should complete an approved Alpha export, but attempts to name Beta in a request, reuse Beta’s job ID or follow Beta’s download link must fail. Test alternate formats, scheduled exports and pagination endpoints, because access control is sometimes applied only to the visible interactive endpoint. Vary role type, membership changes and account suspension. Record API response, job state, storage objects created and download outcome for each case.

Test administrative and support workflows separately. A designated support engineer may need cross-tenant troubleshooting under customer approval, but should not be able to invoke the same export path invisibly using their personal account. Establish just-in-time elevation, purpose, ticket reference and independent review. A cross-tenant support entitlement must not be inherited by generic background workers or all users in a support group. If a master tenant exists for internal reporting, it should have a distinct, supervised workflow with specifically authorised datasets.

Keep logs useful without copying more customer data

For each export, log actor, authorised tenant, selected dataset, job ID, worker identity, object key, delivery token issuance, completion state and byte count. Avoid logging full exported payloads or sensitive identifiers unnecessarily. Correlate an export request to the exact archive delivered, and capture denied cross-tenant attempts with enough metadata to investigate. An audit event saying "report generated" does not demonstrate which customer records were included. Where a customer asks who accessed its information, the platform should be able to answer from its own records.

Monitor abnormal export volume and unusual changes to job configuration, but do not depend entirely on anomaly detection. A single cross-tenant export can be damaging despite looking routine in volume. Apply database row-scoping or other enforced tenancy rules where appropriate, and require the export service to specify its authorised dataset when generating queries. Verify that bulk and analytics engines use the same policy as the normal application, especially after migrations that introduce new worker queues.

Decide readiness by negative results

A release gate should require an authorised export, a rejected different-tenant request, a rejected cross-tenant job lookup, a rejected stolen or expired download URL and a revoked user’s scheduled job behaving according to the documented policy. Test a mid-job failure for residual files. Record exact versions and worker deployment configuration in the evidence pack. An assurance statement that the site supports SSO is unrelated to whether the export service enforces tenant isolation. The useful conclusion is that no customer-controlled identifier can grant an export beyond the specific membership and delegation the platform recognises.

Consider a stale delegation during background execution

Imagine a customer analyst schedules an overnight export, then loses access to the account before the job runs. The service must decide what happens to the pending request. A design that treats the earlier approval as a durable right may still be valid for some audited business operations, but the choice must be deliberate and scoped; it must not emerge because the worker does not know how to query current membership. Document whether the job cancels, revalidates the user’s rights or executes under a distinct approved service entitlement. Test the exact behaviour with synthetic data.

A related case is a customer organisation split. Records migrate from a single tenant into two separate entities, but old queued jobs retain the previous tenant identifier. The exporter should not accidentally include records now belonging to the new legal or administrative boundary. Establish migration cutover rules, tenant mapping and the status of in-flight jobs. Reconcile generated archives to the final authorised scope before making download links available. Do not attempt a blanket background replay of old export jobs during migration without rechecking authorisation context.

Inspect the delivery and cleanup endpoints

Sometimes the export is correctly scoped, but anyone who guesses a job ID can poll its status or retrieve a presigned URL from the completion endpoint. Test enumeration resistance and explicit ownership checks using unrelated synthetic customers. Ensure that status responses do not disclose confidential document names, report filters or support contact details. Limit token lifetime and prevent sensitive content from entering general application logs. An archive left in a publicly reachable object store is still an isolation failure even if the initial API was correctly protected.

Review failed or cancelled jobs as a separate class. Inspect temporary databases, processing disks, error traces and notification payloads to determine whether incomplete exports persist beyond the documented lifecycle. The closure test is not simply that a customer can no longer click "download"; it should prove that unauthorised identities cannot retrieve the remaining artefacts through any supported path. Assign deletion ownership and telemetry so an export control failure can be contained and explained without needing to copy real customer data into the security team’s evidence system.

A further control to demonstrate

Include row counts and selected record IDs in a synthetic export verification record, but do not expose customer payloads through generic job logs. Reconcile expected objects to the final archive manifest, especially after a worker retry. An export worker that combines partial results from separate attempts may accidentally include objects from an earlier job context. Treat the archive manifest as a controlled artefact and validate its tenant membership before issuing the final download token. This is particularly important when a service scales workers horizontally and retries jobs after infrastructure interruptions.

Final verification detail

Customer support may request a completed export to resolve a service dispute. Give staff a way to view job metadata and error details without automatically downloading the customer’s data. If content access is justified, require a scoped, reviewed action and record the retrieved archive. An export system that is isolated from other tenants can still leak information through an unrestricted support console.

Sources and further reading

How Next Defence supports this work

Next Defence can help teams validate tenant-scoped export jobs, background-worker permission checks and download-token revocation with synthetic SaaS accounts. Engagements are scoped to authorised systems and the organisation’s operational and legal requirements.

Explore related security capabilities

LET'S TALK

Let’s talk about your security.

Tell us what you are protecting, where you need greater visibility or what you want to achieve. We will help identify the right next step.

Talk to a Security Specialist

Describe your security requirements. Please do not submit passwords, credentials or confidential incident evidence. This form is not an emergency incident-response channel.

Form powered by HubSpot. Review our Privacy Policy. If the form doesn’t load, email [email protected].