Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f5ec6289
Commit
f5ec6289
authored
Sep 06, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed XSS with merge request approvers selection
Closes #353
parent
1725bd1c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
ee/app/assets/javascripts/approvers_select.js
ee/app/assets/javascripts/approvers_select.js
+1
-1
ee/changelogs/unreleased/security-mr-approvers-xss.yml
ee/changelogs/unreleased/security-mr-approvers-xss.yml
+5
-0
ee/spec/javascripts/approvers_select_spec.js
ee/spec/javascripts/approvers_select_spec.js
+18
-0
No files found.
ee/app/assets/javascripts/approvers_select.js
View file @
f5ec6289
...
...
@@ -114,7 +114,7 @@ export default class ApproversSelect {
}
static
formatSelection
(
group
)
{
return
group
.
full_name
||
group
.
name
;
return
_
.
escape
(
group
.
full_name
||
group
.
name
)
;
}
static
formatResult
({
...
...
ee/changelogs/unreleased/security-mr-approvers-xss.yml
0 → 100644
View file @
f5ec6289
---
title
:
Fixes XSS with merge request approvers selection
merge_request
:
author
:
type
:
security
ee/spec/javascripts/approvers_select_spec.js
View file @
f5ec6289
...
...
@@ -59,4 +59,22 @@ describe('ApproversSelect', () => {
expect
(
output
).
not
.
toContain
(
'
<script>alert("testing")</script>
'
);
});
});
describe
(
'
formatSelection
'
,
()
=>
{
it
(
'
escapes full name
'
,
()
=>
{
expect
(
ApproversSelect
.
formatSelection
({
full_name
:
'
<script>alert("testing")</script>
'
,
}),
).
not
.
toBe
(
'
<script>alert("testing")</script>
'
);
});
it
(
'
escapes name
'
,
()
=>
{
expect
(
ApproversSelect
.
formatSelection
({
name
:
'
<script>alert("testing")</script>
'
,
}),
).
not
.
toBe
(
'
<script>alert("testing")</script>
'
);
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment