VYPR
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.

PackageAffected versionsPatched versions
DjbletsPyPI
< 0.7.300.7.30
DjbletsPyPI
>= 0.8, < 0.8.30.8.3

Affected products

5
  • cpe: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

3
e2c79117efd9

Update the 0.8.3 release notes with the CVEs.

https://github.com/djblets/djbletsChristian HammondJun 8, 2014via ghsa
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:
    
50000d0bbb98

Update the 0.7.30 release notes with the CVEs.

https://github.com/djblets/djbletsChristian HammondJun 8, 2014via ghsa
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:
    
77ac64642ad5

Fix a XSS vulnerability in the gravatar template tag.

https://github.com/djblets/djbletsChristian HammondJun 6, 2014via ghsa
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="&quot;&gt;&lt;script&gt;alert(1);&lt;/script&gt;&lt;&quot;" '
    +            'class="gravatar"/>')
    

Vulnerability mechanics

Synthesis attempt was rejected by the grounding validator. Re-run pending.

References

11

News mentions

0

No linked articles in our index yet.