CVE-2026-15920

Potential cross-site scripting via URLField values in the admin

Published Aug 4, 2026 CVSS 4.0 · 5.1 Medium EPSS < 1% KEV · Not listed
Description
An issue was discovered in Django 5.2 before 5.2.17 and 6.0 before 6.0.8.
`django.contrib.admin.utils.display_for_field()` renders `URLField` values as clickable links in the admin without validating the URL. A value stored with an unsafe scheme is displayed as a link on changelist and read-only admin pages, which allows cross-site scripting against staff users who click the link.
Exploitation requires the unsafe value to already be stored in the database. `URLField` validation through a `ModelForm` or the admin rejects unsafe schemes, so this affects applications that persist `URLField` data without running model validation, for example through direct queryset writes, deserialization, or bulk import of untrusted input.
Django would like to thank Egor Saltykov for reporting this issue.

Analysis

AI-generated

Technical impact

A stored XSS flaw exists in Django 5.2 before 5.2.17 and 6.0 before 6.0.8. When data is persisted in a URLField without model validation, the admin’s display_for_field helper renders the value as a clickable link without checking the scheme. After clicking the link, a staff user can trigger arbitrary script execution in the admin browser context, compromising confidentiality and integrity. The weakness is identified as CWE‑83 (Unvalidated URL input used in HTML output) and CWE‑79 (Cross‑Site Scripting).

Affected Systems

The vulnerability impacts installations of the Django framework, specifically Django 5.2 prior to version 5.2.17 and Django 6.0 prior to 6.0.8. Any application that stores URLField values directly in the database, bypassing model form validation, is potentially affected.

Risk and Exploitability

The CVSS score of 5.1 indicates a medium severity risk. Exploitation requires that an unsafe scheme value already exist in the database; it can be triggered by a staff‑level admin clicking the rendered link. The EPSS is not available, and the issue is not listed in CISA’s KEV catalog. The attack would proceed by a user interacting with the admin interface, so it is an in‑application attack vector aimed at authenticated staff accounts.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to Django 5.2.17 or later, or Django 6.0.8 or later, to receive the fix that validates URL schemes in the admin.
  • Identify and sanitize or remove any URLField values in the database that contain unsafe schemes such as file:, data:, or javascript: before upgrading, to prevent existing data from triggering the XSS.
  • Modify application writes to URLField values so that all updates pass through a ModelForm or custom validation that rejects unsafe URL schemes, thereby preventing future persistence of insecure data.

Generated by OpenCVE AI on August 5, 2026 at 13:39 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4736-1 python-django security update
History
Type Values Removed Values Added
CPEs cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Djangoproject
Djangoproject django
Vendors & Products Djangoproject
Djangoproject django
Type Values Removed Values Added
Description An issue was discovered in Django 5.2 before 5.2.17 and 6.0 before 6.0.8. `django.contrib.admin.utils.display_for_field()` renders `URLField` values as clickable links in the admin without validating the URL. A value stored with an unsafe scheme is displayed as a link on changelist and read-only admin pages, which allows cross-site scripting against staff users who click the link. Exploitation requires the unsafe value to already be stored in the database. `URLField` validation through a `ModelForm` or the admin rejects unsafe schemes, so this affects applications that persist `URLField` data without running model validation, for example through direct queryset writes, deserialization, or bulk import of untrusted input. Django would like to thank Egor Saltykov for reporting this issue.
Title Potential cross-site scripting via URLField values in the admin
Weaknesses CWE-83
References
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'}

cvssV4_0

{'score': 5.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

  • CWE-83

    Improper Neutralization of Script in Attributes in a Web Page

Sources

Status
PUBLISHED
Assigner
DSF
Published
Updated
Aug 4, 2026, 5:21 PM
Reserved
Jul 15, 2026, 8:32 PM
Status
Analyzed
Published
Aug 4, 2026, 5:16 PM
Modified
Oct 24, 2026, 4:10 PM
Severity
Moderate
Public date
Aug 4, 2026, 3:48 PM