Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. djangorestframework
  4. ›
  5. CVE-2024-21520

CVE-2024-21520: Cross-site Scripting in djangorestframework

June 26, 2024 (updated December 31, 2024)

Versions of the package djangorestframework before 3.15.2 are vulnerable to Cross-site Scripting (XSS) via the break_long_headers template filter due to improper input sanitization before splitting and joining with tags.

References

  • github.com/advisories/GHSA-gw84-84pc-xp82
  • github.com/encode/django-rest-framework
  • github.com/encode/django-rest-framework/commit/3b41f0124194430da957b119712978fa2266b642
  • github.com/encode/django-rest-framework/compare/3.15.1...3.15.2
  • github.com/encode/django-rest-framework/pull/9435
  • nvd.nist.gov/vuln/detail/CVE-2024-21520
  • security.snyk.io/vuln/SNYK-PYTHON-DJANGORESTFRAMEWORK-7252137

Code Behaviors & Features

Detect and mitigate CVE-2024-21520 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 3.15.2

Fixed versions

  • 3.15.2

Solution

Upgrade to version 3.15.2 or above.

Impact 6.1 MEDIUM

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

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

pypi/djangorestframework/CVE-2024-21520.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:55 +0000.