Lucene search

K
githubGitHub Advisory DatabaseGHSA-QW9G-7549-7WG5
HistoryMar 01, 2024 - 4:58 p.m.

Directus has MySQL accent insensitive email matching

2024-03-0116:58:20
CWE-706
GitHub Advisory Database
github.com
13
directus
mysql
password reset
vulnerability
accent insensitive
email matching
exploit
database
security
vulnerability management

8.2 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

LOW

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N

7 High

AI Score

Confidence

Low

0.0004 Low

EPSS

Percentile

9.1%

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:

  1. 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)
  2. A off-by-one accented domain cรผre53.de can be registered to be able to receive emails.
  3. 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"}
  1. 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.
  2. 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

Affected configurations

Vulners
Node
rangerstudiodirectusRangeโ‰ค10.8.2
CPENameOperatorVersion
directusle10.8.2

8.2 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

LOW

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N

7 High

AI Score

Confidence

Low

0.0004 Low

EPSS

Percentile

9.1%

Related for GHSA-QW9G-7549-7WG5