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.
Published: 2026-08-04
Score: 5.1 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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.

Generated by OpenCVE AI on August 4, 2026 at 19:38 UTC.

Remediation

No vendor fix or workaround currently provided.

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 4, 2026 at 19:38 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 04 Aug 2026 18:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Tue, 04 Aug 2026 18:15:00 +0000

Type Values Removed Values Added
First Time appeared Djangoproject
Djangoproject django
Vendors & Products Djangoproject
Djangoproject django

Tue, 04 Aug 2026 16:30:00 +0000

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'}


Subscriptions

Djangoproject Django
cve-icon MITRE

Status: PUBLISHED

Assigner: DSF

Published:

Updated: 2026-08-04T17:21:13.428Z

Reserved: 2026-07-15T20:32:49.882Z

Link: CVE-2026-15920

cve-icon Vulnrichment

Updated: 2026-08-04T17:21:05.231Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-04T18:00:13Z

Weaknesses
  • CWE-83

    Improper Neutralization of Script in Attributes in a Web Page