Headline
CVE-2022-4526: Prevent XSS injection with default template. · richardbarran/django-photologue@960cb06
A vulnerability was found in django-photologue up to 3.15.1 and classified as problematic. Affected by this issue is some unknown functionality of the file photologue/templates/photologue/photo_detail.html of the component Default Template Handler. The manipulation of the argument object.caption leads to cross site scripting. The attack may be launched remotely. Upgrading to version 3.16 is able to address this issue. The name of the patch is 960cb060ce5e2964e6d716ff787c72fc18a371e7. It is recommended to apply a patch to fix this issue. VDB-215906 is the identifier assigned to this vulnerability.
@@ -54,3 +54,13 @@ def test_archive_day_photo_works(self):
def test_detail_photo_works(self):
response = self.client.get(‘/ptests/photo/2011/12/23/fake-photo/’)
self.assertEqual(response.status_code, 200)
def test_detail_photo_xss(self):
“""Check that the default templates handle XSS.""”
self.photo.title = ‘<img src=x onerror=alert(“title”)>’
self.photo.caption = ‘<img src=x onerror=alert(origin)>’
self.photo.save()
response = self.client.get(‘/ptests/photo/2011/12/23/fake-photo/’)
self.assertContains(response, ‘Photologue Demo - <img src=x onerror=alert(“title”)>’)
self.assertNotContains(response, ‘<img src=x onerror=alert(“title”)>’)
self.assertContains(response, ‘<img src=x onerror=alert(origin)>’)
self.assertNotContains(response, ‘<img src=x onerror=alert(origin)>’)
Related news
A vulnerability was found in django-photologue up to 3.15.1 and classified as problematic. Affected by this issue is some unknown functionality of the file photologue/templates/photologue/photo_detail.html of the component Default Template Handler. The manipulation of the argument object.caption leads to cross site scripting. The attack may be launched remotely. Upgrading to version 3.16 is able to address this issue. The name of the patch is 960cb060ce5e2964e6d716ff787c72fc18a371e7. It is recommended to apply a patch to fix this issue. VDB-215906 is the identifier assigned to this vulnerability.