-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix XSS vulnerability in project selector (#3797)
* Fix XSS vulnerability in project selector @getsentry/security
- Loading branch information
Showing
2 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from __future__ import absolute_import | ||
|
||
from django.template import Context, Template | ||
|
||
from sentry.testutils import TestCase | ||
|
||
|
||
class SerializeDetailedOrgTest(TestCase): | ||
TEMPLATE = Template(""" | ||
{% load sentry_api %} | ||
{% serialize_detailed_org org %} | ||
""") | ||
|
||
def test_escapes_js(self): | ||
org = self.create_organization(name='<script>alert(1);</script>') | ||
|
||
result = self.TEMPLATE.render(Context({ | ||
'org': org, | ||
})) | ||
|
||
assert '<script>' not in result | ||
assert '<script>' in result |