cve.bz

CVE-2026-81318 Distinct-query aggregate drops the tenant schema prefix, leaking across tenants in AshSql

2.1 lowEPSS 0.2%Fix available

Low (2.1) in ash-project ash sql. EPSS 0.2% estimated probability of exploitation activity in the next 30 days. Fixed in ash_sql 0.7.1.

On this page
Incorrect Authorization vulnerability in ash-project ash_sql allows a caller in a schema-based multitenant application to receive aggregate values computed from another tenant's rows. When an aggregate is computed over a distinct query, AshSql.AggregateQuery.add_single_aggs/5 rebuilds the outer query from query.from.source alone, which is only the {table, schema} tuple and does not carry query.prefix or query.from.prefix. For strategy(:context) multitenancy those hold the tenant schema, so the rebuilt outer query reads the repo's default schema while the inner correlated subquery still reads the tenant schema, and the two are joined only on primary key. The aggregate, and any relationship join added off the prefix-less binding, is then computed against the wrong tenant's rows. The neighbouring limit and exists branches instead wrap the query with subquery/1, which preserves the prefix. This issue affects ash_sql: from 0.1.0 before 0.7.1.

Severity

CVSS 4.0

2.1 low
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
EPSS
0.2% (unchanged from 0.2% a week ago; 0.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 8th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: no · Technical impact: partial, assessed 2026-08-31. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-863 Incorrect Authorization
OWASP Top 10
A01:2025 Broken Access Control
Published
Modified
Assigned by
EEF (CNA)
NVD analysis
Deferred: the NVD does not plan to analyze it
Record from
the NVD, synced

Fix and patched versions

  • ash_sql (Hex): fixed in 0.7.1

Ask an AI about this CVE

Show the promptExplain CVE-2026-81318 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-81318?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-81318?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-81318 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
ash-project ash_sqlfrom 0.1.0 before 0.7.1

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
EEF-CVE-2026-81318Hexash_sql>=0.1.0 <0.7.10.7.1
EEF-CVE-2026-81318v0.7.0, v0.6.9, v0.6.8, v0.6.7, v0.6.6 and 150 moreno fix published

References

Check your stackJSON