Cloudanix VulnDB

CVE-2024-21543

High · 7.1

CVSS

7.1

EPSS

0.5%

Published

Dec 13, 2024

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A software component used for user logins could let people in with just a username and password even when extra security steps like two-factor codes were supposed to be required.

Exploitation
Remote Authenticated
Attacker needs
Low Privilege
Complexity
Low
Impact
Privilege Gain
Component
Library
Class
Authentication Bypass
Remediation
Upgrade
Effort
Low
Patch risk
Low

What it actually does

When the package's authenticate() function fails, the code falls back to a direct database query using supplied credentials, granting access while skipping any configured custom authentication backends such as two-factor authentication or LDAP.

Why it matters to the business

Attackers with valid usernames and passwords can reach protected resources without completing required secondary authentication steps, increasing the chance of account takeover and unauthorized data access.

How an attack unfolds

An attacker supplies a valid username and password to an application using the vulnerable djoser version; the authenticate() call fails or is not reached, causing the fallback direct database lookup to succeed and return an authenticated session that bypasses all AUTHENTICATION_BACKENDS checks.

How to fix it

Upgrade sunscrapers/djoser to commit d33c3993c0c735f23cbedc60fa59fce69354f19d or later release 2.3.0 or newer; verify that custom AUTHENTICATION_BACKENDS are still invoked on every login attempt after the upgrade.

How to confirm the fix worked

After upgrade, attempt login with credentials that require a custom backend (for example 2FA) and confirm the backend is still enforced; review application dependency manifests to ensure no older djoser versions remain.

Typical attack path

  1. Identify an application endpoint that accepts username/password via djoser authentication views
  2. Submit valid credentials that would normally be rejected or augmented by custom backends
  3. Observe successful session creation despite missing 2FA, LDAP, or other backend requirements
  4. Use the resulting authenticated session to access protected resources or APIs

How to detect it

Review web server and application logs for successful authentication events that lack corresponding records from secondary backends such as OTP or LDAP queries; compare timestamps of login success against expected custom backend calls.

What your security team should do

  • Immediately upgrade all djoser installations to the fixed commit or 2.3.0
  • Audit authentication logs for any successful logins that bypassed secondary factors in the past 30 days
  • Add automated dependency scanning to CI pipelines to prevent future vulnerable versions
  • Test authentication flows in staging that exercise all configured backends before deploying the fix

The record

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.

Affected packages

Ecosystem Package Introduced Fixed
PyPI djoser 0 d33c3993c0c735f23cbedc60fa59fce69354f19d
PyPI djoser 0 2.3.0
Debian:11 djoser 0 No fix
Debian:11 djoser 0 2.1.0-1+deb11u1
Debian:12 djoser 0 No fix
Debian:13 djoser 0 2.3.1-1
Debian:14 djoser 0 2.3.1-1
Ubuntu:20.04:LTS djoser 0 No fix
Ubuntu:22.04:LTS djoser 0 No fix
Ubuntu:22.04:LTS djoser 0 2.1.0-1ubuntu0.22.04.1
Ubuntu:24.04:LTS djoser 0 No fix
Ubuntu:24.04:LTS djoser 0 2.1.0-1ubuntu0.24.04.1
Ubuntu:24.10 djoser 0 No fix
Ubuntu:Pro:16.04:LTS djoser 0 No fix
Ubuntu:Pro:18.04:LTS djoser 0 No fix
Ubuntu:Pro:20.04:LTS djoser 0 2.0.3-1ubuntu0.1~esm1

Related vulnerabilities