Am I affected?

type your ash_postgres version to check

Description

Incorrect Authorization vulnerability in ash-project ash_postgres allows a user to read another tenant's record through a skipped upsert.

When Ash.bulk_create/4 or a single create runs as an upsert with return_skipped_upsert?: true and the upsert is skipped (for example because its upsert_condition does not hold), AshPostgres.DataLayer reads the existing row back by the upsert identity in do_bulk_create/3 and upsert/4. That lookup did not apply the resource's attribute multitenancy, so on a resource using strategy :attribute it could match and return the row of another tenant with the same identity values, exposing its fields to the caller.

This issue affects ash_postgres: from 2.6.22 before 2.15.2.

Weaknesses & attack patterns

Weakness

CWE-863 · Incorrect Authorization in catalog → MITRE ↗

Attack patterns

CAPEC-1 · Accessing Functionality Not Properly Constrained by ACLs MITRE ↗

A user of one tenant whose upsert is skipped receives another tenant's record with the same identity values.

Affected — Hex / ash_postgres Hex.pm ↗ Repository ↗

≥ 2.6.22 < 2.15.2 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash_postgres:*:*:*:*:*:*:*:*
version type semver
modules · source files · routines
modules 'Elixir.AshPostgres.DataLayer'
source files lib/data_layer.ex
routines 'Elixir.AshPostgres.DataLayer':do_bulk_create/3 · 'Elixir.AshPostgres.DataLayer':upsert/4 · 'Elixir.AshPostgres.DataLayer':bulk_create/3

Affected — GitHub / ash-project/ash_postgres Repository ↗

≥ af0903f < 8aa8122 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash_postgres:*:*:*:*:*:*:*:*
version type git
modules · source files · routines
modules 'Elixir.AshPostgres.DataLayer'
source files lib/data_layer.ex
routines 'Elixir.AshPostgres.DataLayer':do_bulk_create/3 · 'Elixir.AshPostgres.DataLayer':upsert/4 · 'Elixir.AshPostgres.DataLayer':bulk_create/3

Configurations

Reachable when a resource uses attribute multitenancy, an action performs upserts with return_skipped_upsert?: true, and a caller can supply identity values that another tenant also uses.

References

Credits

Will Townsend Finder Reporter
Zach Daniel / Ash Project Remediation developer

CVSS breakdown

CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
« All CVEs