Skip to content

tenant-audit: updateMany on tenant-scoped sys_http_delivery / sys_notification_delivery runs without options.tenantId — un-isolated writes on multi-org shapes #10673

Description

@os-zhuang

Platform half of objectstack-ai/cloud#1512 (filed by the triage seat; the hotcrm crm_contract half stays on that card). Measured on a composed multi-org boot (EE 4.1.0 image, OS_TENANCY_POSTURE=isolated), the tenant-audit instrument prints:

[tenant-audit] updateMany on tenant-scoped object "sys_http_delivery" without
options.tenantId — writes will not be tenant-isolated.
[tenant-audit] updateMany on tenant-scoped object "sys_notification_delivery" without
options.tenantId — writes will not be tenant-isolated.

These are the platform's own delivery objects (webhook / notification delivery bookkeeping). On single-org shapes the missing scope is harmless; on multi-org shapes an unscoped updateMany is a cross-tenant write.

What the fix must decide, per call site

Find the updateMany call sites for these two objects (webhooks / notifications delivery maintenance paths) and, for each, either:

  • pass the request's options.tenantId (if the operation is tenant-contextual), or
  • mark it bypassTenantAuditonly if it is genuinely a global maintenance task (e.g. env-wide retention sweep) — with a comment saying why.

Silencing the audit line without classifying the write is not a fix; the audit exists to force exactly this classification.

Repro

EE 4.1.0 image + deploy/composed.env.example + a composed artifact boot; read docker compose logs app during startup. Green = no [tenant-audit] line for these two objects, or an explicit, justified bypass at each remaining site.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions