Ash マルチテナント環境で別テナントのレコードを上書き・奪取される
Summary
Ash の upsert 処理で主キーの衝突判定がテナントで絞り込まれないため、あるテナントの利用者が別テナントのレコードを読み取り、上書きし、自分のテナントへ移動させられるおそれがあります。影響を受けるのは Hex の ash 1.22.0 から 3.37.2 より前のバージョンです。修正版の 3.37.2 以降へ更新してください。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
Ash の upsert 処理で主キーの衝突判定がテナントで絞り込まれないため、あるテナントの利用者が別テナントのレコードを読み取り、上書きし、自分のテナントへ移動させられるおそれがあります。影響を受けるのは Hex の ash 1.22.0 から 3.37.2 より前のバージョンです。修正版の 3.37.2 以降へ更新してください。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| ash-projectash |
≥ 2333d01ddf37e5909769a513059b27e3183331c5, < c9f0cdb31e7c084def05f3f5be69dd7bb7721754→ c9f0cdb31e7c084def05f3f5be69dd7bb7721754 |
c9f0cdb31e7c084def05f3f5be69dd7bb7721754 |
| Hexash |
≥ 1.22.0, < 3.37.2→ 3.37.2 |
3.37.2 |
Original description The description as published by the source.
Summary
Authorization Bypass Through User-Controlled Key vulnerability in ash-project ash allows a user of one tenant to read, overwrite and take over another tenant's records via an upserting create action.
Under attribute multitenancy, Ash.Actions.Create (lib/ash/actions/create/create.ex) and Ash.Actions.Create.Bulk (lib/ash/actions/create/bulk.ex) upserted on the primary key, or on an all_tenants? identity, without scoping the conflicting record to the request's tenant. A caller of a create action with upsert? true that accepts the primary key, supplying a record id from another tenant, updated that record's upsert fields and received all of its attributes in the result. With the default upsert fields the tenant attribute was written too, moving the record into the caller's tenant. Read and update policies do not run for upserts, and tenant-scoped create policies pass because the tenant is the caller's own.
This issue affects ash: from 1.22.0 before 3.37.2.
Impact
A signed-in user of one tenant posts another tenant's record id to an upserting create action, receives that record's attributes, overwrites its upsert fields, and with the default upsert fields moves it into their own tenant.
Workarounds
Add upsert_condition expr( == ^tenant()) to every create action that upserts on the primary key or on an all_tenants? identity, and do not combine it with return_skipped_upsert?. An upsert into another tenant's record then fails with `Ash.Error.…
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- advisory github.com
- advisory nvd.nist.gov
- package hex.pm
- package github.com
- patch github.com
- REDHAT Red Hat
- web cna.erlef.org
- web osv.dev
- web github.com
- web github.com
- web repo.hex.pm