Dev.to Security 🔐 Cybersecurity 👁 0 📖 3 min read

CVE-2026-129239: CVE-2026-129239: Privilege Escalation and Unauthorized Data Exposure in Directus SharesService

CVE-2026-129239: Privilege Escalation and Unauthorized Data Exposure in Directus SharesService Vulnerability ID: CVE-2026-129239 CVSS Score: 6.5 Published: 2026-11-16 Directus versions prior to 12.3.1 contain an aut

CVE-2026-129239: Privilege Escalation and Unauthorized Data Exposure in Directus SharesService

Vulnerability ID: CVE-2026-129239
CVSS Score: 6.5
Published: 2026-11-16

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.

TL;DR

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.

Technical Details

  • 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

Affected Systems

  • Directus (directus)
  • @directus/api
  • @directus/system-data
  • Directus: < 12.3.1 (Fixed in: 12.3.1)

Code Analysis

Commit: 5869c06

Prevent manual modification of user_created and revalidate share access on collection/item updates in SharesService; restrict default update fields in system-data.

File: api/src/services/shares.ts
@@ -46,6 +46,41 @@ export class SharesService extends ItemsService {
    }

    override async updateMany(keys: PrimaryKey[], data: Partial<Item>, opts?: MutationOptions): Promise<PrimaryKey[]> {
+       if ('user_created' in data) {
+           throw new InvalidPayloadError({ reason: `You can't change the "user_created" value manually` });
+       }
+
+       if (('item' in data || 'collection' in data) && this.accountability) {
+           let shares = [data];
+
+           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));
+           }
+
+           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();

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',

Commit: 973be10

Release v12.3.1

Mitigation Strategies

  • Upgrade Directus (@directus/api and @directus/system-data) to version 12.3.1 or later to enforce code-level immutability on user_created and re-run share access checks on collection/item updates.
  • Restrict field-level update permissions on the directus_shares collection for all non-administrative roles by removing wildcard (*) field access and explicitly disallowing updates to user_created, role, collection, and item.
  • Audit directus_activity and directus_revisions tables for historical update actions on directus_shares where the delta contains modifications to user_created or role.

Remediation Steps:

  1. Update the Directus deployment to v12.3.1 using npm, pnpm, or the official directus/directus:12.3.1 Docker image.
  2. Log into the Directus admin interface and navigate to Settings > Access Policies / Roles & Permissions.
  3. Locate all non-admin policies/roles with Update permissions on directus_shares and restrict allowed fields to ['name', 'collection', 'item', 'role', 'password', 'date_start', 'date_end', 'max_uses', 'times_used'], ensuring user_created is unchecked.
  4. Run the SQL audit query against directus_revisions and directus_shares to verify that no existing share records attribute user_created to an administrator while having been created by a non-admin user.

References

Read the full report for CVE-2026-129239 on our website for more details including interactive diagrams and full exploit analysis.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.