Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS1xdzlnLTc1NDktN3dnNc4AA5r0
Directus has MySQL accent insensitive email matching
Password reset vulnerable to accent confusion
The 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.
This is due to the fact that by default MySQL/MariaDB are configured for accent-insenstive and case-insensitve comparisons.
MySQL weak comparison:
select 1 from directus_users where '[email protected]' = 'julian@cüre53.de';
This 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.
Steps to reproduce:
- If the attacker knows the email address of the victim user, i.e.,
[email protected]
. (possibly just the domain could be enough for an educated guess) - A off-by-one accented domain
cüre53.de
can be registered to be able to receive emails. - With this email the attacker can request a password reset for
julian@cüre53.de
.
POST /auth/password/request HTTP/1.1
Host: example.com
[...]
{"email":"julian@cüre53.de"}
- The supplied email (julian@cüre53.de) gets checked against the database and will match the non-accented email
[email protected]
and will continue to email the password reset link to the provided email address instead of the saved email address. - With this email the attacker can log into the target account and use it for nefarious things
Workarounds
Should be possible with collations but haven't been able to confirm this.
References
- https://www.monolune.com/articles/what-is-the-utf8mb4_0900_ai_ci-collation/
- https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-sets.html
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1xdzlnLTc1NDktN3dnNc4AA5r0
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: 11 months ago
Updated: 11 months ago
CVSS Score: 8.2
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N
EPSS Percentage: 0.0011
EPSS Percentile: 0.44963
Identifiers: GHSA-qw9g-7549-7wg5, CVE-2024-27295
References:
- https://github.com/directus/directus/security/advisories/GHSA-qw9g-7549-7wg5
- https://github.com/directus/directus/commit/a8ef790ea2d28b1727f9027d99bd360920d57919
- https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-sets.html
- https://www.monolune.com/articles/what-is-the-utf8mb4_0900_ai_ci-collation
- https://nvd.nist.gov/vuln/detail/CVE-2024-27295
- https://github.com/advisories/GHSA-qw9g-7549-7wg5
Blast Radius: 16.9
Affected Packages
npm:directus
Dependent packages: 16Dependent repositories: 115
Downloads: 29,409 last month
Affected Version Ranges: <= 10.8.2
Fixed in: 10.8.3
All affected versions: 9.0.0, 9.0.1, 9.1.0, 9.1.1, 9.1.2, 9.2.0, 9.2.1, 9.2.2, 9.3.0, 9.4.0, 9.4.1, 9.4.2, 9.4.3, 9.5.0, 9.5.1, 9.5.2, 9.6.0, 9.7.0, 9.7.1, 9.8.0, 9.9.0, 9.9.1, 9.10.0, 9.11.0, 9.11.1, 9.12.0, 9.12.1, 9.12.2, 9.13.0, 9.14.0, 9.14.1, 9.14.2, 9.14.3, 9.14.5, 9.15.0, 9.15.1, 9.16.0, 9.16.1, 9.17.0, 9.17.1, 9.17.2, 9.17.3, 9.17.4, 9.18.0, 9.18.1, 9.19.0, 9.19.1, 9.19.2, 9.20.0, 9.20.1, 9.20.2, 9.20.3, 9.20.4, 9.21.0, 9.21.2, 9.22.0, 9.22.1, 9.22.3, 9.22.4, 9.23.1, 9.23.3, 9.23.4, 9.24.0, 9.25.0, 9.25.1, 9.25.2, 9.26.0, 10.0.0, 10.1.0, 10.1.1, 10.2.0, 10.2.1, 10.3.0, 10.3.1, 10.4.1, 10.4.2, 10.4.3, 10.5.0, 10.5.1, 10.5.2, 10.5.3, 10.6.0, 10.6.1, 10.6.2, 10.6.3, 10.6.4, 10.7.0, 10.7.1, 10.7.2, 10.8.0, 10.8.1, 10.8.2
All unaffected versions: 10.8.3, 10.9.0, 10.9.1, 10.9.2, 10.9.3, 10.10.0, 10.10.1, 10.10.2, 10.10.3, 10.10.4, 10.10.5, 10.10.6, 10.10.7, 10.11.0, 10.11.1, 10.11.2, 10.12.0, 10.12.1, 10.13.0, 10.13.1, 10.13.2, 10.13.4, 11.0.0, 11.0.1, 11.0.2, 11.1.0, 11.1.1, 11.1.2, 11.2.0, 11.2.1, 11.2.2, 11.3.0, 11.3.1, 11.3.2, 11.3.3, 11.3.4, 11.3.5