CVE-2024-39701: Directus incorrect handling of _in filter

CVE-2024-39701 · Severity: low · CVSS 3.1 · Published 2024-07-08

Directus is a headless CMS platform that uses filter rules to control access to data based on user roles and permissions. A flaw in the `_in` and `_nin` filter operators causes them to incorrectly treat empty or null arrays as valid matches, allowing users to bypass access control rules and gain unauthorized access to data and functionality they should not be able to access.

Technologies: directus (npm). Vendors: npm.

Quick answers

Is CVE-2024-39701 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2024-39701 being exploited in the wild.
How severe is CVE-2024-39701?
Low severity, with a CVSS score of 3.1, published 8 July 2024.
Which products and versions are affected?
directus (npm) SEMVER:introduced=9.23.0,fixed=10.6.0.
Is there a fix for CVE-2024-39701?
Yes. directus (npm): upgrade to 10.6.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2024-39701 attacked?
It is attacked over the network.
Am I affected by CVE-2024-39701?
Check whether you run directus (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • directus (npm): upgrade to 10.6.0 or later
    npm install directus@10.6.0

Technical details

The vulnerability is an improper access control issue (CWE-284) in the `_in` and `_nin` filter operators in Directus versions 9.23.0 through 10.5.3. When a filter expression evaluates a field against an empty or null array (e.g., `{"role": {"_in": $CURRENT_USER.some_field}}` where `some_field` is null), the filter incorrectly evaluates to true instead of false. This requires the attacker to be authenticated with low privileges and have access to features that rely on these filters, such as the directus-extension-role-chooser. An attacker can exploit this to escalate their privileges or access resources beyond their intended permissions. The vulnerability was fixed in version 10.6.0.

Affected products

  • Directus Directus >=9.23.0, <=10.5.3

Identifiers

  • CVE-2024-39701
  • GHSA-hxgm-ghmv-xjjm

Timeline

  • 2024-07-08: disclosed
  • 2024-07-08: patched: Fixed in version 10.6.0

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.