Sanaan Fayaz Wani

directus/directus

GHSA-xf86-hfpm-92xr

AI Chat route exposes admin-only tools to non-admin users

GHSA-xf86-hfpm-92xr

3.1

Low

CVSS 3.1 base

  1. 2026-05-22Reported privately
  2. 150 days later2026-10-19Published by the maintainer

What to do

If you run directus 11.14.0 to before 12.3.0, upgrade to 12.3.0 or later.

Anyone who can reach it over the network, with a low-privilege account and no user interaction, given conditions outside the attacker's control, can read some data.Read from the CVSS 3.1 vector

CVSS 3.1 metrics

To exploit it

Attack vector
Network
Attack complexity
High
Privileges required
Low
User interaction
None

What it gets

Confidentiality
Low
Integrity
None
Availability
None
Scope
Unchanged

Open this vector in the FIRST calculator ↗

Weakness
CWE-863 Incorrect Authorization
CVE
not assigned
Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N
2026-05-22Reported privately
150 days
2026-10-19Published by the maintainer

My analysis of this finding: root cause, the vulnerable code, the impact and the fix, in the site’s format. The official advisory of record is linked above.

Affected versions

Package Ecosystem Vulnerable Fixed in
directus npm >= 11.14.0, < 12.3.0 12.3.0

Summary

Directus (versions <= 11.17.4) ships two different ways to call its AI tools: the MCP server and the AI chat route. The MCP server guards the five tools marked admin: true (collections, fields, relations, flows, operations), but the chat route does not. Any authenticated user with app_access can ask the chat endpoint to run admin tools the MCP path would refuse them, so the two entry points disagree on who is allowed to do what.

Where it lives

The chat route converts each requested tool into an AI SDK tool in api/src/ai/chat/utils/chat-request-tool-to-ai-sdk-tool.ts. At lines 21 to 26 it looks the tool up by name from ALL_TOOLS and wires it in, but it never reads directusTool.admin:

// api/src/ai/chat/utils/chat-request-tool-to-ai-sdk-tool.ts:21-26// looks up the tool by name from ALL_TOOLS// and builds the AI SDK tool// no check of directusTool.admin anywhere here

The bugthe admin flag is never read on this path

The MCP server, by contrast, enforces the flag in both the listing and the execution path:

// api/src/ai/mcp/server.ts:200  (listing)
if (req.accountability?.admin !== true && tool.admin === true) continue;

// api/src/ai/mcp/server.ts:223  (execution)
if (req.accountability?.admin !== true && tool.admin === true)
    throw new ForbiddenError(...);

So the same tool definitions carry an admin: true flag that one dispatcher honors and the other ignores. The flag is the intended control; the chat route simply skips it.

Impact

This is an incorrect authorization flaw (CWE-863). A non-admin user who holds app_access can drive the chat route to invoke collections, fields, relations, flows, and operations, the schema and automation tooling that Directus reserves for admins. The MCP server denies these to non-admins, which confirms the intended trust boundary and makes the chat route’s omission a genuine bypass rather than a design choice. A low privilege app_access user, with no further interaction, gains read access to the schema and flow metadata that should be admin-only. The maintainers scored the impact as limited disclosure with no integrity impact (C:L/I:N), and because the runtime run below was not completed I do not claim any write effect beyond that.

I want to be precise about what I verified. The missing check is confirmed at the code level by comparing the two dispatchers line for line. The live end-to-end run was not completed because exercising the chat route needs a configured AI provider key, so I did not capture a runtime transcript for this one. The authorization gap in the source is unambiguous; the runtime proof is the piece I flag as outstanding.

Fix

Mirror the MCP server’s guard in the chat route. After the tool lookup at line 26, reject admin tools for non-admin callers before the tool is ever handed to the model:

if (directusTool.admin && accountability.admin !== true) {    throw new ForbiddenError({        reason: 'You must be an admin to access this tool',    });}

The fixrejects admin tools for non-admin callers

Better still, both dispatchers should share one admin-enforcement helper so the admin flag cannot be honored in one place and forgotten in another.

The record

Weakness
CWE-863 Incorrect Authorization
Affected
directus 11.14.0 to before 12.3.0
Fixed in
12.3.0
Disclosure
2026-05-22 Reported privately
150 days later2026-10-19 Published
Advisory
GHSA-xf86-hfpm-92xr

About this writeup

Sanaan Fayaz Wani (GitHub sfwani) reported this vulnerability to the directus maintainers under coordinated disclosure and is credited as a reporter in GHSA-xf86-hfpm-92xr, published 2026-10-19.

All published findings: advisory index.