Intel

AIKIDO-2026-22244

ash_sql is vulnerable to Information Disclosure

Information DisclosureCVE-2026-81318 Published Yesterday

21

Low Risk

This Affects:

ELIXIRash_sql
0.0.1 - 0.7.0
Fixed in 0.7.1
Are you affected? Scan for Free

TL;DR

The AshSql.AggregateQuery.add_single_aggs/5 function rebuilds the outer query when computing aggregates over a distinct query, reconstructing it from query.from.source alone. That reconstruction discards the Ecto.Query prefix metadata where Ash stores the tenant schema for schema-based multitenancy, so the rebuilt query reads from the repository's default public schema. With sequential primary keys, aggregate values and downstream joins can match rows belonging to the wrong tenant. The fix preserves the query prefix so aggregates run against the correct tenant schema.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you use schema-based multitenancy with aggregates computed over distinct queries.

Background info

ash_sql is vulnerable to Information Disclosure in versions 0.0.1 - 0.7.0.

How to fix this

Upgrade the ash_sql library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform