mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
[3.1.x] Fixed CVE-2020-13596 -- Fixed potential XSS in admin ForeignKeyRawIdWidget.
This commit is contained in:
committed by
Carlton Gibson
parent
0186b43073
commit
49d7cc19e3
@@ -27,6 +27,14 @@ class Band(models.Model):
|
||||
return self.name
|
||||
|
||||
|
||||
class UnsafeLimitChoicesTo(models.Model):
|
||||
band = models.ForeignKey(
|
||||
Band,
|
||||
models.CASCADE,
|
||||
limit_choices_to={'name': '"&><escapeme'},
|
||||
)
|
||||
|
||||
|
||||
class Album(models.Model):
|
||||
band = models.ForeignKey(Band, models.CASCADE)
|
||||
featuring = models.ManyToManyField(Band, related_name='featured')
|
||||
|
||||
Reference in New Issue
Block a user