CVE-2024-21543 djoser Authentication Bypass

Medium 5.7 Published Updated

Attackers can bypass two-factor authentication and other custom checks by exploiting a fallback to direct database queries in the djoser library.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-21543?

CVE-2024-21543 is a medium-severity authentication bypass vulnerability in djoser, published on 13 Dec 2024. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

Versions of the package djoser before 2.3.0 are vulnerable to Authentication Bypass when the authenticate() function fails. This is because the system falls back to querying the database directly, granting access to users with valid credentials, and eventually bypassing custom authentication checks such as two-factor authentication, LDAP validations, or requirements from configured AUTHENTICATION_BACKENDS.

Weakness: CWE-295, CWE-287

Which versions are affected by CVE-2024-21543?

3 open source packages ship an affected version, including djoser.

PackageAffectedFixed in
djoser PyPIAll versions2.3.0
djoser PyPIAll versions2.3.0
djoser PyPIAll versions2.3.0

How do I fix CVE-2024-21543?

Upgrade djoser to 2.3.0 or later.

Upgrade, and rotate credentials and sessions that may have been exposed. More about Authentication bypass.

Is CVE-2024-21543 being exploited?

There is no known exploitation of CVE-2024-21543 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2024-21543, DLA-4060-1, GHSA-v49p-m6gh-747c, PYSEC-2024-158, UBUNTU-CVE-2024-21543, USN-7354-1.

Is CVE-2024-21543 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free