An asynchronous export changes the usual authorization model. A user selects Export, the API creates a job, a worker later assembles a file, the application sends a notification, and a download link is finally issued. Between those steps, the user's role, tenant membership, or access to source objects may change. A successful check when the job is queued therefore does not prove that the file may still be delivered after access is revoked.

Testing should trace one export object through every state and separately answer who may create the job, observe its status, receive its notification, and download its output. A general REST API security assessment provides the broader context; the narrow question here is whether authorization decisions remain valid over time.

Define the product promise first

Several policies can be defensible. An export may be cancelled immediately when a user leaves a project. A completed file may remain available for a short declared period. An administrative report may survive revocation of the initiator if ownership moves to a service role. Leaving the behavior implicit is dangerous because a tester cannot tell whether access ten minutes later is a defect or an intended feature.

Requirements should name the subject, tenant, source data set, recheck point, and scope of revocation. “Revoke access” is also ambiguous: removing a role, removing tenant membership, disabling an account, ending a session, and revoking an OAuth grant may affect different artifacts. Acceptance criteria should state the expected outcome for each mechanism.

Map every export job state

The endpoint inventory needs a state model. At minimum, map creation, queueing, execution, completion, notification, metadata retrieval, signed-link creation, download, and deletion. For every transition, record which service decides and which facts it uses: current role, a permission snapshot, job ownership, or the worker's service identity.

Asynchronous export validation path
  1. Requestthe user creates a job inside an authorized tenant
  2. Executionthe worker recalculates the permitted data set
  3. Deliverythe API checks current rights before issuing a link
  4. Downloadstorage limits the object, lifetime, and allowed operation

If the worker trusts only a stored user_id while the download endpoint trusts only an unguessable job_id, the checks at different layers do not add up to authorization. A random identifier can be useful, but it remains a reference rather than evidence of entitlement.

Test object and tenant boundaries on every read

The matrix should include the job owner, another user in the same tenant, a user from another tenant, and an administrator whose authority is explicitly defined. Change the job, file, and notification identifiers, and vary the path: job list, direct endpoint, notification history, and reuse of a previously issued link.

Scroll sideways to compare

StateControl questionAcceptance evidence
QueuedIs the job cancelled after the role is lost?transition log and inaccessible status
RunningAre newly forbidden records excluded?data-set composition and policy decision
ReadyCan a former member read metadata?responses for each role and tenant
Link issuedDoes a bearer link survive revocation?result before and after revocation
Download startedWhat happens to an open stream?an explicitly agreed test boundary

Cross-tenant checks belong in dedicated test tenants with synthetic data. The allowed actions and limits can be recorded with the penetration-test scope planner.

Separate token revocation from permission revocation

Revoking a refresh token prevents new access tokens from being minted through the relevant grant, but the behavior of already issued tokens depends on architecture and policy. A self-contained, short-lived access token may remain usable until expiry when a resource server does not consult current state. Deleting a session cookie in one browser may leave the server session or sessions on other devices active.

Run the scenario with retained artifacts: an old cookie, access token, refresh token, and open tab. After revocation, repeat job-status access, file retrieval, and creation of a new link. Also establish whether the worker assembled a broader data set before the user lost access.

Treat a signed URL as temporary authority

A signed URL is commonly a bearer artifact: anyone holding it can perform the signed operation until it expires or its underlying signing authority becomes invalid. A short lifetime reduces exposure, but does not make the link single-use or automatically bind it to the current user. If the product promises immediate revocation, an expiry time alone is insufficient.

Possible designs include issuing a link only after a current authorization check, using a download endpoint that authorizes again, narrowly scoping the object and lifetime, or supporting invalidation. Proxy and analytics logs should not retain the signature. The report must distinguish “no new link can be issued” from “an old link no longer works”; these are separate properties.

An illustrative acceptance scenario

Consider an analyst in tenant A who starts a quarterly order export. The job waits in a queue for two minutes. An administrator removes the analyst from the tenant, but the analyst retains an open tab, access token, and job-page URL. The tester verifies that status no longer reveals the filename or row count, the worker either cancels the task or produces only the result allowed by policy, the notification provides no hidden access path, and no new download link is issued.

Next, test a link created before revocation. If the requirement promises immediate cutoff, the download should fail. If the agreed policy allows a short residual period, record it as a deliberate limitation with a measurable lifetime. This scenario is illustrative: it describes a method and makes no claim about a particular product.

Accept evidence that preserves the timeline

A useful result connects the test user, tenant, API and worker versions, job identifier, revocation timeline, and response from every access path. A screenshot of one HTTP response is weak without the preceding steps because it does not show which token was used or when the role changed. Reports should redact live tokens, URL signatures, and real personal data while preserving correlation.

Give each test a status such as confirmed, inaccessible, not applicable, or unknown. One failed download in one browser does not prove revocation of all sessions and links. The structure can be compared with a sample penetration-test report.

When independent testing helps

An independent API penetration test is useful after changes to the export pipeline, tenant model, SSO integration, or file-delivery mechanism, and before accepting a feature that handles sensitive data. The parties should agree on test roles, revocation semantics, safe export volumes, and permission to exercise signed links.

Pentest.red can assess this lifecycle as a focused scenario and return reproducible evidence for every state. The result confirms the behavior of the agreed version under stated conditions; it cannot guarantee the absence of other defects or replace change control after testing.

PENTEST.RED

Discuss pentest scope and pricing

We start by agreeing on systems, access, constraints and the expected evidence.

Prepare your testing scope

Based on in-depth research, edited for clarity and practical use.

PENTEST.RED / RED JOURNAL