1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed CVE-2020-13596 -- Fixed potential XSS in admin ForeignKeyRawIdWidget.

This commit is contained in:
Jon Dufresne
2020-05-26 09:51:02 +02:00
committed by Carlton Gibson
parent 81dc710571
commit 2dd4d110c1
5 changed files with 36 additions and 3 deletions

View File

@@ -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')