CWE-284Identity & accessSeverity · High

Background jobs that cross tenants

An export, report or scheduled job trusts the tenant ID it is given. One customer can then trigger a job that reads or writes another customer's data.

At a glance

Controls
CWE-284 · A01:2021 Broken Access Control
Typical severityHigh
ReferenceCWE-284
OWASP Top 10A01:2021 Broken Access Control

What it is

Requests from the web app usually check which tenant the caller belongs to. Background jobs run later, with no signed-in user, and act on whatever tenant ID was placed in the job. If that ID came from the request, the caller chose it.

An attacker starts an export or report and changes the tenant or account ID in the request. The job runs with full access and delivers another customer's data to the attacker's inbox or download link. AI-assisted attackers test every ID field in a request, including ones that only matter later.

Where it hides

What a reviewer can look for in the code and in the behaviour, before anyone proves it.

  • Data export and download jobs
  • Scheduled reports and email digests
  • Webhook delivery and sync jobs
  • Import jobs that write records under a tenant ID from the file or request

How MATT tests it

The proof runs against the deployed product, on every release, whoever wrote the code.

  1. 01Read the code to see where each job gets its tenant ID and whether it checks it.
  2. 02Create two test tenants, then as a user in tenant A start an export with tenant B's ID in the request.
  3. 03Record whether the job output holds any tenant B test data.
The rule, in plain English

Work done for one customer must never read or write another customer’s data.

Executable check

as user in tenant A: POST /v1/exports with tenant_id set to tenant B expect: 403, or the job runs for tenant A only open the export output expect: no record from tenant B

Every rule MATT holds →

What the fix looks like

  1. 01

    Take the tenant ID from the signed‑in session when the job is created, and ignore any value in the request.

  2. 02

    Re‑check that the job's creator still belongs to that tenant when the job runs.

  3. 03

    Scope every query in the job to the tenant ID, ideally through row‑level security or a tenant‑scoped data layer.

  4. 04

    Send job output only to users of the same tenant.

A check that was never written is found by proving the deployed behaviour, fixed with the engineer who shipped it, and kept fixed by running the control on every change. What is ExploitOps? →

ExploitOps discovery call

Understand where your security loop breaks.

A call with a MATT co-founder to understand your product and whether an ExploitOps Review is worth doing. If there is a real need, we scope one with the research team.

Let’s understand your priority

What brings you to MATT?

What would you like help with?
01 / 02