Am I affected?

type your ash_graphql version to check

Description

Exposure of Data Element to Wrong Session vulnerability in ash-project ash_graphql can deliver one subscription's resolved records to a different subscriber's topic.

AshGraphql.Subscription.Batcher.do_send/5 reads the resolved batch from the process dictionary via Process.get(:batch_resolved) and then unconditionally deletes it. That is sound only inside a task the library owns. On the :backpressure_sync and :noproc fallbacks do_send/5 runs inline in the publishing caller's process, so if a resolver inside an outer do_send/5 triggers another synchronous Ash notification, the inner call finds the outer run's value still under :batch_resolved, adopts it as its own result, and publishes it to the inner topic, a different subscription document with a different actor and tenant. It then deletes the key, so the outer run publishes nothing. The key is not namespaced by run, so records cannot be told apart. The fix saves, clears, and restores :batch_resolved around each run.

This issue affects ash_graphql: from 1.4.0 before 1.11.0.

Weaknesses & attack patterns

Weakness

CWE-488 · Exposure of Data Element to Wrong Session in catalog → MITRE ↗

Attack patterns

CAPEC-12 · Choosing Message Identifier MITRE ↗

Affected — Hex / ash_graphql Hex.pm ↗ Repository ↗

1.4.0 < 1.11.0 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash_graphql:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.AshGraphql.Subscription.Batcher'
source files lib/subscription/batcher.ex
routines 'Elixir.AshGraphql.Subscription.Batcher':do_send/5

Affected — GitHub / ash-project/ash_graphql Repository ↗

3cb2c98 < b798ef5 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash_graphql:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.AshGraphql.Subscription.Batcher'
source files lib/subscription/batcher.ex
routines 'Elixir.AshGraphql.Subscription.Batcher':do_send/5

Configurations

The application uses ash_graphql subscriptions where a subscription resolver's execution can itself emit an Ash notification, and delivery takes the synchronous :backpressure_sync or :noproc (missing-batcher) path rather than a library-owned task.

References

Credits

Peter Ullrich Finder Reporter
Zach Daniel / Ash Project Remediation developer
Jonatan Männchen / EEF Coordinator

CVSS breakdown

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