Nov 17, 2026·10 min read·2 visits
An incorrect authorization check during share updates in Directus (< 12.3.1) allows authenticated users to overwrite the creator and role identifiers of an owned share with administrator UUIDs, escalating the read permissions of the generated guest share to administrative levels.
Directus versions prior to 12.3.1 contain an authorization bypass and privilege management flaw in the SharesService component. Authenticated non-administrative users with update permissions on the directus_shares collection can modify the user_created, role, item, and collection fields of an existing owned share. Because the update operation validates permissions solely against the pre-update record state without revalidating the modified fields, an attacker can reassign share ownership and role context to an administrator. Subsequent guest access using the share token derives administrative accountability, exposing restricted relational data.
Directus is a Node.js-based headless Content Management System (CMS) and real-time API platform that wraps SQL databases. A core feature of the platform is the ability to generate external data shares, which are managed through the directus_shares system collection and processed by the SharesService class within the @directus/api package. These shares allow authenticated users to expose specific database items to unauthenticated external guests via unique tokens.
In versions prior to 12.3.1, SharesService exhibits an authorization and privilege management flaw classified under CWE-863 (Incorrect Authorization) and CWE-269 (Improper Privilege Management). When an authenticated non-administrative user updates an existing share record they own, the API verifies ownership against the pre-update database row but fails to restrict or revalidate modifications to sensitive metadata columns in the update payload.
Specifically, the update path allows the caller to modify the user_created, role, collection, and item attributes of the share record. By overwriting user_created and role with the UUIDs of an administrator account and administrator role, and optionally repointing collection and item to restricted tables, the user alters the security context of the share.
When the share token is subsequently used to authenticate a guest session, Directus derives the session's accountability from the mutated user_created and role fields. Because both fields now reference administrative entities, the guest session is granted administrative read privileges for the target item and any relational data reachable from it.
To understand the root cause of CVE-2026-129239, it is necessary to examine how Directus constructs the Accountability object for guest share sessions. When an unauthenticated client accesses the API using a share token, Directus queries the directus_shares table to resolve the permission boundaries for the session. The system evaluates both the role assigned to the share and the user_created field indicating which user generated the share. If both user_created and role resolve to administrative identifiers, the permission engine grants unrestricted schema visibility and read access for the shared item tree.
During the initial creation of a share (createOne or createMany), Directus enforces two critical security invariants. First, the database insertion logic automatically populates the user_created column with the UUID of the currently authenticated user ($CURRENT_USER), preventing impersonation. Second, SharesService explicitly invokes validateAccess with the share action to confirm the caller has permission to share the specified collection and item.
The vulnerability stems from asymmetric validation logic between the creation path and the update path (SharesService.updateMany). Prior to version 12.3.1, SharesService inherited standard item mutation behavior from the base ItemsService class without restricting sensitive columns during update operations. When processing a PATCH /shares/:id request, the authorization engine checked the pre-update row against the standard permission filter (user_created._eq: $CURRENT_USER).
Once this initial ownership check passed, the update payload was merged directly into the database record without post-update validation. Furthermore, the default recommended application permissions defined in @directus/system-data granted non-admin users wildcard field update rights (fields: ['*']) on directus_shares rows they created. This combination allowed the caller to overwrite user_created with an arbitrary user UUID and modify collection and item without triggering a subsequent validateAccess check.
The remediation for CVE-2026-129239 was implemented in Pull Request #28145 (commit 5869c06f6997af0d2f13b39b3d19297dd2ed2f65) across two primary packages: @directus/api and @directus/system-data.
In api/src/services/shares.ts, the updateMany method in SharesService previously passed the mutation payload directly to super.updateMany(keys, data, opts) before clearing the permissions cache. The patch introduces explicit input validation and access re-verification prior to executing the parent class update method.
// File: api/src/services/shares.ts
override async updateMany(keys: PrimaryKey[], data: Partial<Item>, opts?: MutationOptions): Promise<PrimaryKey[]> {
// 1. Block manual modification of the share creator
if ('user_created' in data) {
throw new InvalidPayloadError({ reason: `You can't change the "user_created" value manually` });
}
// 2. Re-validate share permissions if target collection or item is modified
if (('item' in data || 'collection' in data) && this.accountability) {
let shares = [data];
// Fetch existing values if only one of 'item' or 'collection' is present in the update payload
if (!('item' in data) || !('collection' in data)) {
shares = await this.knex.select('collection', 'item').from('directus_shares').whereIn('id', keys);
}
const itemsByCollection = new Map<string, Set<PrimaryKey>>();
for (const share of shares) {
const collection = 'collection' in data ? data['collection'] : share['collection'];
const item = 'item' in data ? data['item'] : share['item'];
itemsByCollection.set(collection, (itemsByCollection.get(collection) ?? new Set()).add(item));
}
// Verify the acting user has 'share' permission on the newly specified target(s)
for (const [collection, items] of itemsByCollection) {
await validateAccess(
{
accountability: this.accountability,
action: 'share',
collection,
primaryKeys: [...items],
},
{
schema: this.schema,
knex: this.knex,
},
);
}
}
const primaryKeys = await super.updateMany(keys, data, opts);
await clearPermissionsCache();
return primaryKeys;
}The patched updateMany method enforces two critical checks. First, it inspects the data object for the presence of the user_created key and immediately throws an InvalidPayloadError if found, ensuring the creator attribution remains immutable after row creation. Second, if either item or collection is present in the update payload, the service resolves the resulting collection-item pairs (querying the database for existing values if only one of the two fields was supplied in the partial update) and calls validateAccess with action: 'share' for each target.
In addition to the service-level enforcement, the default permission template in packages/system-data/src/app-access-permissions/index.ts was hardened to follow the principle of least privilege.
// File: packages/system-data/src/app-access-permissions/index.ts
@@ -203,7 +203,7 @@ export const appRecommendedPermissions: Partial<Permission>[] = [
_eq: '$CURRENT_USER',
},
},
- fields: ['*'],
+ fields: ['name', 'collection', 'item', 'role', 'password', 'date_start', 'date_end', 'max_uses', 'times_used'],
},
{
collection: 'directus_shares',By replacing fields: ['*'] with an explicit allowlist that omits user_created and date_created, the system prevents standard app access roles from modifying audit metadata at the RBAC layer.
> [!NOTE]
> Fix Completeness Assessment: While role remains in the allowlist of editable fields, keeping user_created immutable neutralizes the privilege escalation vector. In Directus, a guest share cannot exceed the permissions of user_created. Even if a non-admin user sets role to an administrator role UUID, the effective permissions of the share remain bounded by the non-admin creator's own access rights.
Exploiting CVE-2026-129239 requires an authenticated non-administrative user account that possesses permissions to create and update records in directus_shares, as well as permission to share at least one item in any collection. The attacker must also know or discover the UUID of an administrator user and the UUID of the administrator role (for example, via exposed foreign key relations in accessible collections or predictable UUID configurations).
The attacker first creates a valid share for an item they are authorized to access and share (e.g., an item in the articles collection with ID 10).
POST /shares HTTP/1.1
Host: directus.example.com
Authorization: Bearer <LOW_PRIVILEGE_USER_TOKEN>
Content-Type: application/json
{
"name": "Initial Share",
"collection": "articles",
"item": "10"
}The server responds with the created share object, including its primary key id (e.g., a1b2c3d4-e5f6-7890-abcd-ef1234567890), and automatically sets user_created to the attacker's UUID.
The attacker sends a PATCH request targeting the newly created share ID. Because the pre-update record's user_created matches $CURRENT_USER, the authorization check succeeds. The payload overwrites user_created and role with administrator UUIDs and repoints the share to a restricted collection or item containing relational links to sensitive data.
PATCH /shares/a1b2c3d4-e5f6-7890-abcd-ef1234567890 HTTP/1.1
Host: directus.example.com
Authorization: Bearer <LOW_PRIVILEGE_USER_TOKEN>
Content-Type: application/json
{
"user_created": "<ADMIN_USER_UUID>",
"role": "<ADMIN_ROLE_UUID>",
"collection": "internal_projects",
"item": "1"
}With the database row updated, the attacker authenticates as a guest using the share ID to obtain a share access session, and then queries the target item using deep relational field expansion (e.g., ?fields=*.*.*).
Because the share record now attributes both user_created and role to an administrator, Directus resolves the query under administrative accountability, returning restricted fields and nested relational records from internal_projects that the low-privileged user account could not otherwise read.
The primary impact of CVE-2026-129239 is unauthorized information disclosure resulting from privilege escalation within the read path of shared items. It is assigned a CVSS v3.1 base score of 6.5 (Medium) with the vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
The Confidentiality impact is rated High (C:H) because elevating a share's accountability context to that of an administrator bypasses row-level and field-level read restrictions for the shared item and all relational tables linked to it. If the target collection has foreign-key relationships to sensitive system or application tables (such as directus_users, customer records, or financial data), an attacker can traverse those relationships using Directus's nested fields query parameter to exfiltrate confidential database contents.
Conversely, the Integrity (I:N) and Availability (A:N) impacts are rated None. Directus shares are strictly read-only constructs; authenticating via a share token does not issue a general-purpose administrator bearer token, nor does it enable POST, PATCH, or DELETE operations against the underlying data model. Furthermore, successful exploitation depends on specific preconditions: the attacker must hold an authenticated account with share creation and update privileges, and must know valid administrator user and role UUIDs.
As of this writing, the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, has an EPSS score of 0.00%, and has no publicly known weaponized exploits in the wild.
Organizations running affected versions of Directus (all v11.x and v12.x releases prior to 12.3.1) should upgrade to version 12.3.1 or later. The update enforces immutability on the user_created field within SharesService.updateMany and ensures that any modification to a share's collection or item triggers a full access validation check against the acting user's accountability.
# Upgrade via npm
npm install directus@12.3.1
# Upgrade via pnpm
pnpm update directus@12.3.1
# Upgrade via Docker
docker pull directus/directus:12.3.1> [!IMPORTANT]
> Upgrading Directus packages updates the code-level check in SharesService, which immediately blocks manual modification of user_created. However, existing database permission rows in directus_permissions created prior to the upgrade will not be automatically rewritten by the package update. Administrators should also review their configured role permissions.
If an immediate version upgrade is not operationally feasible, administrators can mitigate the vulnerability entirely through the Directus Access Control configuration:
directus_shares system collection.*) to an explicit selection.user_created and date_created so callers cannot alter record ownership.collection, item, and role if non-administrative users do not require the ability to retarget or change the role of existing shares after creation.Security teams can audit their Directus database to determine whether this vulnerability was exploited prior to patching by querying the directus_activity and directus_revisions tables for share update events that modified user_created or role:
SELECT
a.id AS activity_id,
a.action,
a.user AS acting_user,
a.timestamp,
r.collection,
r.item AS share_id,
r.delta
FROM directus_activity a
JOIN directus_revisions r ON a.id = r.activity
WHERE a.collection = 'directus_shares'
AND a.action = 'update'
AND (r.delta LIKE '%user_created%' OR r.delta LIKE '%role%');CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
Directus Directus | < 12.3.1 | 12.3.1 |
| Attribute | Detail |
|---|---|
| Vulnerability ID | CVE-2026-129239 (GHSA-7h45-q5jx-7r87) |
| CWE Classification | CWE-863 (Incorrect Authorization) / CWE-269 (Improper Privilege Management) |
| CVSS v3.1 Score | 6.5 Medium (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N) |
| Attack Vector | Network (Authenticated REST/GraphQL API) |
| Affected Component | @directus/api (SharesService) & @directus/system-data |
| Impact | High Confidentiality Impact (Admin-level read exposure via guest share) |
| Exploit Status | None (No public PoCs or active exploitation) |
| Patched Version | Directus v12.3.1 |
The application performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check, allowing attackers to bypass intended access restrictions.
CVE-2026-129301 (GHSA-8cgq-x343-p74c) is an uncaught exception and MIME interpretation conflict vulnerability in the Python email parsing library mail-parser (versions >= 4.6.0 and < 4.6.3). The write_attachments() function iterates over parsed email attachments without per-attachment exception containment. When processing a specially crafted MIME part containing an RFC 2231-encoded null byte in the filename, a basename exceeding filesystem NAME_MAX limits, or a malformed base64 payload, the function raises an unhandled standard library exception (ValueError, OSError, or binascii.Error). This prematurely aborts the attachment extraction loop, preventing subsequent attachments from being written to disk for downstream security inspection while also triggering unhandled worker crashes in applications that only catch MailParserError.
CVE-2026-88987 (GHSA-qqrg-8jpm-8mph) is a stored Cross-Site Scripting (XSS) vulnerability in the Silverstripe Framework prior to version 6.2.13. The framework's HTML sanitization engine, XssSanitiser, relies on an incomplete regular expression denylist when filtering URI schemes in HTML attributes. Specifically, the sanitizer strips data:text/html URIs but fails to restrict executable XML and XHTML media types such as data:application/xhtml+xml, data:text/xml, and data:application/xml. An authenticated user with content creation privileges can embed crafted data URIs inside HTML attributes like iframe src or object data, leading to arbitrary JavaScript execution when the content is rendered by a victim's browser.
A Stored Cross-Site Scripting (XSS) vulnerability exists in Silverstripe Framework versions prior to 6.2.13 within the SilverStripe\Core\XssSanitiser component. The HTML sanitizer fails to strip SVG data URIs (data:image/svg*) from dangerous HTML attributes such as href, src, lowsrc, and data. Authenticated CMS authors can persist crafted SVG data URIs in stored content, leading to arbitrary JavaScript execution in the browser context of users who view or interact with the rendered page.
CVE-2026-88989 (tracked as GHSA-3qh3-54qg-gpq3) is a missing authorization vulnerability (CWE-862) in the Silverstripe Framework affecting versions prior to 6.2.13. The flaw exists within the GridFieldDetailForm_ItemRequest request handler, which orchestrates record creation and editing workflows inside the Silverstripe CMS backend. Specifically, the server-side persistence method saveFormIntoRecord() fails to verify whether an authenticated user possesses the necessary creation permissions (canCreate) when processing an unpersisted DataObject record. Consequently, a low-privileged CMS user who has permission to access a GridField interface and edit existing records can bypass role-based creation restrictions. By sending a crafted HTTP POST request directly to the item/new endpoint with the action_doSave parameter, the user can instantiate and persist unauthorized database records. The vulnerability is rated Medium severity with a CVSS v3.1 base score of 4.3 and is remediated in Silverstripe Framework version 6.2.13.
Silverstripe Framework prior to version 6.2.13 contains an improper privilege management vulnerability (CWE-269) within the Group authorization and validation logic. A delegated administrator possessing the CMS_ACCESS_SecurityAdmin permission, but lacking full ADMIN privileges, can edit or reparent groups that acquire administrative capabilities indirectly via permission roles or ancestor inheritance. By adding their own account to such a group or moving a controlled group underneath a role-privileged parent, the user escalates to full administrative access across the CMS.
A missing authorization and type validation vulnerability in Silverstripe Framework prior to version 6.2.13 allows authenticated CMS users to convert database records into arbitrary DataObject classes via user-controlled ClassName parameters in GridField detail forms.