CVE-2024-39701: Directus Incorrectly handles _in` filter

Published Jul 8, 2024
·
Updated

Summary Directus >=9.23.0, <=v10.5.3 improperly handles in, nin operators. It evaluates empty arrays as valid so expressions like {"role": {"in": $CURRENTUSER.somefield}} would evaluate to true allowing the request to pass.

Details This results in Broken Access Control because the rule fails to do what it was intended to do: Pass rule if field matches any of the values. ref: https://docs.directus.io/reference/filter-rules.html#filter-operators In my example this would translate to "Pass rule if <collection>.role matches any of []". Which should fail. This instead passes in Directus <= v10.5.3, >=v9.23.0

PoC {"role": {"in": $CURRENTUSER.somefield}} field validation would pass if $CURRENTUSER.somefield is null.

Real scenario: Using https://github.com/u12206050/directus-extension-role-chooser with the specified versions of Directus (I tested on 10.0.0) allows users with access to this feature set their role to whatever role if they don't have any roles assigned (userroles.role is left with the default value, null) despite the validation rule being yaml validation: role: in: $CURRENTUSER.userroles.role Latest version of Directus (v10.8.3 and above) handles the above validation rule correctly.

Impact Permissions fail to open for setups relying on this filter and can lead to users getting access to things they're not supposed to.

Other sources

Directus is a real-time API and App dashboard for managing SQL database content. Directus >=9.23.0, <=v10.5.3 improperly handles in, nin operators. It evaluates empty arrays as valid so expressions like {"role": {"in": $CURRENTUSER.somefield}} would evaluate to true allowing the request to pass. This results in Broken Access Control because the rule fails to do what it was intended to do: Pass rule if field matches any of the values. This vulnerability is fixed in 10.6.0.

— MITRE

Affected Software

2 affected componentsFixes available
npm/directus>=9.23.0<=10.5.3
10.6.0
Monospace Directus>=9.23.0<10.6.0

Event History

Jul 8, 2024
CVE Published
via MITRE·04:43 PM
Data Sourced
via MITRE·04:43 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:15 PM
Affected Software
Advisory Published
via GitHub·06:37 PM

Frequently Asked Questions

1

What is the severity of CVE-2024-39701?

CVE-2024-39701 is classified as a high-severity vulnerability due to its potential for broken access control.

2

How do I fix CVE-2024-39701?

To resolve CVE-2024-39701, upgrade Directus to version 10.6.0 or later.

3

Which versions are affected by CVE-2024-39701?

CVE-2024-39701 affects Directus versions between 9.23.0 and 10.5.3 inclusive.

4

What kind of vulnerability is CVE-2024-39701?

CVE-2024-39701 is a broken access control vulnerability resulting from improper handling of _in and _nin operators.

5

What is the impact of CVE-2024-39701?

The impact of CVE-2024-39701 allows unauthorized access to resources by evaluating empty arrays as valid conditions.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203