CVE-2026-15920: CWE-83: Improper Neutralization of Script in Attributes in a Web Page in djangoproject Django
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.
AI Analysis
Technical Summary
This vulnerability in Django's admin interface involves improper neutralization of script in URLField attributes. The function django.contrib.admin.utils.display_for_field() renders URLField values as clickable links without validating the URL scheme, allowing stored unsafe schemes to execute cross-site scripting attacks on staff users. The vulnerability affects Django versions 5.2 prior to 5.2.17 and 6.0 prior to 6.0.8. Exploitation requires unsafe URL values to be present in the database, which can happen if data bypasses model validation, for example through direct queryset writes or deserialization of untrusted input. The vulnerability is identified as CWE-83 and has a CVSS 3.1 score of 6.1 (medium severity).
Potential Impact
Successful exploitation can lead to cross-site scripting attacks against staff users of the Django admin interface, potentially allowing attackers to execute arbitrary scripts in the context of the admin user's browser session. This can result in information disclosure or session hijacking. However, exploitation requires that unsafe URL values are already stored in the database, which is prevented by standard model validation in forms and the admin interface. Therefore, the impact is limited to applications that persist URLField data without validation.
Mitigation Recommendations
A fix is available in Django versions 5.2.17 and 6.0.8 and later. Users should upgrade to these or newer versions to remediate this vulnerability. Until upgraded, ensure that URLField data is always validated through model validation before being saved to the database to prevent unsafe URL schemes from being stored. Avoid direct database writes or bulk imports of untrusted URLField data without validation.
CVE-2026-15920: CWE-83: Improper Neutralization of Script in Attributes in a Web Page in djangoproject Django
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.
CVSS v3.1
Score 6.1medium
Affected software
djangoproject
Django
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
This vulnerability in Django's admin interface involves improper neutralization of script in URLField attributes. The function django.contrib.admin.utils.display_for_field() renders URLField values as clickable links without validating the URL scheme, allowing stored unsafe schemes to execute cross-site scripting attacks on staff users. The vulnerability affects Django versions 5.2 prior to 5.2.17 and 6.0 prior to 6.0.8. Exploitation requires unsafe URL values to be present in the database, which can happen if data bypasses model validation, for example through direct queryset writes or deserialization of untrusted input. The vulnerability is identified as CWE-83 and has a CVSS 3.1 score of 6.1 (medium severity).
Potential Impact
Successful exploitation can lead to cross-site scripting attacks against staff users of the Django admin interface, potentially allowing attackers to execute arbitrary scripts in the context of the admin user's browser session. This can result in information disclosure or session hijacking. However, exploitation requires that unsafe URL values are already stored in the database, which is prevented by standard model validation in forms and the admin interface. Therefore, the impact is limited to applications that persist URLField data without validation.
Mitigation Recommendations
A fix is available in Django versions 5.2.17 and 6.0.8 and later. Users should upgrade to these or newer versions to remediate this vulnerability. Until upgraded, ensure that URLField data is always validated through model validation before being saved to the database to prevent unsafe URL schemes from being stored. Avoid direct database writes or bulk imports of untrusted URLField data without validation.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- DSF
- Date Reserved
- 2026-07-15T20:32:49.882Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6a72133ebf8831d5391ad463
Added to database: 08/04/2026, 16:28:46 UTC
Last enriched: 08/11/2026, 18:13:49 UTC
Last updated: 09/19/2026, 10:01:30 UTC
Views: 54
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.