Skip to content
Memtru
Demo mode. These are captured runs of the real scenarios against a deliberately broken store and a fixed one. All data is synthetic.

Cross-tenant memory returned to another tenant

criticalConfirmed exposure of data across a tenant boundary.

A principal in another tenant retrieved tenant A's memory.

Expected

Memory written in tenant A is never returned to any principal in tenant B.

Observed

tenant A's fixture was returned to tenant-b/user-1 via search; tenant-b/user-1 via read by id.

Evidence

Steps recorded by the CLI for MT-TEN-002 v1.0.0. Fixture content is shown as a fingerprint; actors are synthetic principals created for this run.

Evidence steps
#ActionActorDetailOutcome
1writetenant-a/user-1user-scoped fixture sha256:913a1d7b94b8stored as mem_000002
2searchtenant-a/user-1query sha256:a65a1b90a5061 result(s); fixture present
3assert-positive controlheld
4read_by_idtenant-a/user-1mem_000002returned fixture
5assert-positive controlheld
6searchtenant-b/user-1query sha256:a65a1b90a5061 result(s); fixture present
7read_by_idtenant-b/user-1mem_000002returned fixture
8searchtenant-b/user-2query sha256:a65a1b90a5060 result(s); fixture absent
9read_by_idtenant-b/user-2mem_000002not found

Reproduction

  1. Write a record containing a unique marker as user-1 in tenant A.
  2. Confirm user-1 in tenant A can retrieve it (positive control).
  3. Search for the marker as user-1 in tenant B (same user id, different tenant).
  4. Search for the marker as user-2 in tenant B.
  5. If read by id is supported, request the record id from both tenant B principals.
Re-run from your configured sandbox
memtru test --scenario MT-TEN-002

Potential causes

Hypotheses to investigate. None of these is confirmed by the test.

  • hypothesisRecords are keyed by user id alone, so equal user ids collide across tenants.
  • hypothesisThe tenant filter is applied as optional metadata the caller controls.

Suggested remediation

  • Derive the tenant from the authenticated session or credential, never from request input, and include it in every query.
  • Treat user ids as unique only within a tenant; key memory by (tenant, user).
  • Enforce tenancy at the storage layer (row-level security, per-tenant indexes or namespaces) so a missed application filter cannot leak data.

Limitations

  • The scenario exercises tenancy through the adapter's context mapping. If the adapter passes tenant as a caller-controlled filter, a PASS shows only that the filter works for this client path, not that the service enforces it.
  • Only the search and read-by-id surfaces exposed by the adapter were exercised.

Identifiers

finding
MTF-ec9547ea-TEN-002
fingerprint
MT-TEN-002:cross_tenant_exposure:659b9a2a5f20
category
tenant_isolation
detected
22 Oct 2026, 06:35 UTC