CVE-2024-27295: Directus Directus Has MySQL Accent Insensitive Vulnerability
HIGHCVE-2024-27295 is a HIGH (CVSS 8.2) directus has mysql accent insensitive vulnerability (CWE-706: Use of Incorrectly-Resolved Name or Reference) affecting Directus libraries in the npm ecosystem. The issue involves directus has mysql accent insensitive email matching. Remediation is available by upgrading affected packages to version 10.8.3.
CVE-2024-27295 at a Glance
Security Impact
CVSS: 8.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N).
How to Fix CVE-2024-27295
To remediate this vulnerability, upgrade all affected Directus dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install directus@10.8.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls directus
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-27295, inspect your project dependencies using npm:
npm ls directus
Analyze the terminal output to locate any version of Directus in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 10.8.3), your application is affected.
Note: The npm ls directus command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-706: Use of Incorrectly-Resolved Name or Reference, where the product uses a name or reference to access a resource, but the name/reference resolves to a resource that is outside of the intended control sphere. In Directus, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-27295 Affected Directus Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
directus
|
npm |
< 10.8.3
|
10.8.3
|
References
Frequently Asked Questions
What is CVE-2024-27295?
Which Directus versions are affected?
What version fixes CVE-2024-27295?
Is directus affected?
What is the CVSS score of CVE-2024-27295?
What CWE is associated with CVE-2024-27295?
How can I check npm dependencies for CVE-2024-27295?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qw9g-7549-7wg5",
"modified" : "2024-03-01T18:58:40Z",
"published" : "2024-03-01T16:58:20Z",
"aliases" : [ "CVE-2024-27295" ],
"summary" : "Directus has MySQL accent insensitive email matching",
"details" : "## Password reset vulnerable to accent confusion\n\nThe password reset mechanism of the Directus backend is implemented in a way where combined with (specific, need to double check if i can work around) configuration in MySQL or MariaDB. As such, it allows attackers to receive a password reset email of a victim user, specifically having it arrive at a similar email address as the victim with a one or more characters changed to use accents. \n\nThis is due to the fact that by default MySQL/MariaDB are configured for accent-insenstive and case-insensitve comparisons.\n\nMySQL weak comparison:\n```sql\nselect 1 from directus_users where 'julian@cure53.de' = 'julian@cüre53.de';\n```\n\nThis is exploitable due to an error in the API using the supplied email address for sending the reset password mail instead of using the email from the database.\n\n### Steps to reproduce:\n\n1. If the attacker knows the email address of the victim user, i.e., `julian@cure53.de`. (possibly just the domain could be enough for an educated guess)\n2. A off-by-one accented domain `cüre53.de` can be registered to be able to receive emails.\n3. With this email the attacker can request a password reset for `julian@cüre53.de`. \n```http\nPOST /auth/password/request HTTP/1.1\nHost: example.com\n[...]\n{\"email\":\"julian@cüre53.de\"}\n```\n4. The supplied email (julian@cüre53.de) gets checked against the database and will match the non-accented email `julian@cure53.de` and will continue to email the password reset link to the provided email address instead of the saved email address.\n5. With this email the attacker can log into the target account and use it for nefarious things\n\n### Workarounds\nShould be possible with collations but haven't been able to confirm this. \n\n### References\n- https://www.monolune.com/articles/what-is-the-utf8mb4_0900_ai_ci-collation/\n- https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-sets.html\n\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "directus"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "10.8.3"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 10.8.2"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/directus/directus/security/advisories/GHSA-qw9g-7549-7wg5"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-27295"
}, {
"type" : "WEB",
"url" : "https://github.com/directus/directus/commit/a8ef790ea2d28b1727f9027d99bd360920d57919"
}, {
"type" : "WEB",
"url" : "https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-sets.html"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/directus/directus"
}, {
"type" : "WEB",
"url" : "https://www.monolune.com/articles/what-is-the-utf8mb4_0900_ai_ci-collation"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-706" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-03-01T16:58:20Z",
"nvd_published_at" : "2024-03-01T16:15:46Z"
}
}