# Trace the job that ran under the wrong account

Contain further work, preserve the job's trusted context and identify every affected artifact. A wrong-tenant job can create consequences beyond its final response.

By Cobnex editorial. Published 2026-09-10. Updated 2026-09-11.

## Stop the affected execution path

Use the supported job or capability control to prevent additional work through the suspected path. Determine whether jobs are still in flight and whether retries can continue after the visible worker stops.

Preserve job identifiers, tenant context, requester identity and operation results in the authorised incident record. Avoid copying tenant content into a broad coordination channel.

Identify the time range and job types affected by the configuration or code path, rather than assuming the reported job is the only case.

## Reconstruct where scope changed

Compare the authenticated request, persisted job record and worker's actual query context. Find whether the tenant was missing, client-controlled, overwritten or inherited from a previous execution.

Inspect connection-pool state, shared mutable variables and cache keys where relevant. A correct tenant field in the queue message does not prove the worker used it for every lookup.

Check the runtime database role and any row-policy bypass. Configuration can undermine an otherwise correct application query model.

## Trace outputs and effects

Locate generated files, notifications, search records and mutations associated with the job. Establish which tenant's data was read and where the result was stored or sent.

Coordinate assessment and response with the responsible security and data owners. Engineering should provide precise evidence about scope and access without making unsupported legal conclusions.

Do not repair records by copying broad snapshots between tenants. Use supported corrective operations with a clear audit trail and verify their target scope independently.

## Verify the corrected boundary

Reproduce the mechanism with synthetic paired tenants, including concurrency and retry conditions. Test the worker and every output access path it uses.

Confirm delayed or queued jobs cannot reintroduce the defect after deployment. Decide whether they need revalidation, cancellation or controlled replay.

Record the failed boundary and add a regression at that level. The incident is resolved technically when scope is preserved through the entire job and its artifacts, with affected historical work accounted for rather than merely hidden from the main screen.

## Sources

- [OWASP: logging guidance](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html)
- [OWASP: multitenant security](https://cheatsheetseries.owasp.org/cheatsheets/Multi_Tenant_Security_Cheat_Sheet.html)
