Moderate severityNVD Advisory· Published Jun 16, 2014· Updated May 6, 2026
CVE-2014-3995
CVE-2014-3995
Description
Cross-site scripting (XSS) vulnerability in gravatars/templatetags/gravatars.py in Djblets before 0.7.30 and 0.8.x before 0.8.3 for Django allows remote attackers to inject arbitrary web script or HTML via a user display name.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
DjbletsPyPI | < 0.7.30 | 0.7.30 |
DjbletsPyPI | >= 0.8, < 0.8.3 | 0.8.3 |
Affected products
5cpe:2.3:a:reviewboard:djblets:*:*:*:*:*:*:*:*+ 4 more
- cpe:2.3:a:reviewboard:djblets:*:*:*:*:*:*:*:*range: <=0.7.29
- cpe:2.3:a:reviewboard:djblets:0.7.27:*:*:*:*:*:*:*
- cpe:2.3:a:reviewboard:djblets:0.7.28:*:*:*:*:*:*:*
- cpe:2.3:a:reviewboard:djblets:0.8.1:*:*:*:*:*:*:*
- cpe:2.3:a:reviewboard:djblets:0.8.2:*:*:*:*:*:*:*
Patches
3e2c79117efd9Update the 0.8.3 release notes with the CVEs.
1 file changed · +4 −0
NEWS+4 −0 modified@@ -5,13 +5,17 @@ version 0.8.3 (6-June-2014): Users could construct a name that would allow for injecting JavaScript in the page. That name is now properly escaped. + This is CVE-2014-3995. + * Fixed a XSS issue in json_dumps. JSON payloads constructed based on user input and then injected into a page could result in custom JavaScript being injected into the page. Additional escaping is now performed to ensure this does not happen. + This is CVE-2014-3994 (discovered by "uchida", bug #3406). + version 0.8.2 (2-June-2014): * Packaging:
50000d0bbb98Update the 0.7.30 release notes with the CVEs.
1 file changed · +4 −0
NEWS+4 −0 modified@@ -5,13 +5,17 @@ version 0.7.30 final (6-June-2014): Users could construct a name that would allow for injecting JavaScript in the page. That name is now properly escaped. + This is CVE-2014-3995. + * Fixed a XSS issue in json_dumps. JSON payloads constructed based on user input and then injected into a page could result in custom JavaScript being injected into the page. Additional escaping is now performed to ensure this does not happen. + This is CVE-2014-3994 (discovered by "uchida", bug #3406). + version 0.7.29 final (9-April-2014): * djblets.webapi:
77ac64642ad5Fix a XSS vulnerability in the gravatar template tag.
2 files changed · +39 −3
djblets/gravatars/templatetags/gravatars.py+5 −3 modified@@ -25,6 +25,7 @@ from __future__ import unicode_literals from django import template +from django.utils.html import format_html from djblets.gravatars import (get_gravatar_url, get_gravatar_url_for_email) @@ -55,9 +56,10 @@ def gravatar(context, user, size=None): url = get_gravatar_url(context['request'], user, size) if url: - return ('<img src="%s" width="%s" height="%s" alt="%s" ' - ' class="gravatar"/>' % - (url, size, size, user.get_full_name() or user.username)) + return format_html( + '<img src="{0}" width="{1}" height="{1}" alt="{2}" ' + 'class="gravatar"/>', + url, size, user.get_full_name() or user.username) else: return ''
djblets/gravatars/templatetags/tests.py+34 −0 added@@ -0,0 +1,34 @@ +from __future__ import unicode_literals + +from django.contrib.auth.models import User +from django.template import Token, TOKEN_TEXT + +from djblets.testing.testcases import TagTest +from djblets.gravatars.templatetags.gravatars import gravatar + + +class DummyRequest(object): + def is_secure(self): + return False + + +class TagTests(TagTest): + """Unit tests for gravatars template tags.""" + def test_gravatar_xss(self): + """Testing {% gravatar %} doesn't allow XSS injection""" + user = User(username='test', + first_name='"><script>alert(1);</script><"', + email='test@example.com') + + node = gravatar(self.parser, Token(TOKEN_TEXT, 'gravatar user 32')) + context = { + 'request': DummyRequest(), + 'user': user, + } + + self.assertEqual( + node.render(context), + '<img src="http://www.gravatar.com/avatar/' + '55502f40dc8b7c769880b10874abc9d0?s=32" width="32" height="32" ' + 'alt=""><script>alert(1);</script><"" ' + 'class="gravatar"/>')
Vulnerability mechanics
Synthesis attempt was rejected by the grounding validator. Re-run pending.
References
11- github.com/djblets/djblets/commit/50000d0bbb983fa8c097b588d06b64df8df483bdnvdPatchWEB
- github.com/djblets/djblets/commit/e2c79117efd925636acd871a5f473512602243cfnvdPatchWEB
- github.com/djblets/djblets/commit/77ac64642ad530bf69e390c51fc6fdcb8914c8e7nvdExploitPatchWEB
- github.com/advisories/GHSA-4xf6-xr96-7vmpghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2014-3995ghsaADVISORY
- seclists.org/oss-sec/2014/q2/494nvdWEB
- seclists.org/oss-sec/2014/q2/498nvdWEB
- github.com/pypa/advisory-database/tree/main/vulns/djblets/PYSEC-2014-79.yamlghsaWEB
- web.archive.org/web/20140702014704/http://seclists.org/oss-sec/2014/q2/498ghsaWEB
- web.archive.org/web/20140702025724/http://seclists.org/oss-sec/2014/q2/494ghsaWEB
- secunia.com/advisories/58691nvd
News mentions
0No linked articles in our index yet.