BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
bf86fba0
Commit
bf86fba0
authored
Apr 18, 2018
by
Phil Hughes
Committed by
Filipa Lacerda
Apr 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'security_issue_42029' into 'security-10-6'
Sanitizes user name to avoid XSS attacks See merge request gitlab/gitlabhq!2365
parent
99845d95
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
2 deletions
+18
-2
sidebar_move_issue.js
app/assets/javascripts/sidebar/lib/sidebar_move_issue.js
+3
-1
security_issue_42029.yml
changelogs/unreleased/security_issue_42029.yml
+5
-0
mock_data.js
spec/javascripts/sidebar/mock_data.js
+1
-1
sidebar_move_issue_spec.js
spec/javascripts/sidebar/sidebar_move_issue_spec.js
+9
-0
No files found.
app/assets/javascripts/sidebar/lib/sidebar_move_issue.js
View file @
bf86fba0
import
_
from
'underscore'
;
function
isValidProjectId
(
id
)
{
return
id
>
0
;
}
...
...
@@ -41,7 +43,7 @@ class SidebarMoveIssue {
renderRow
:
project
=>
`
<li>
<a href="#" class="js-move-issue-dropdown-item">
${
project
.
name_with_namespace
}
${
_
.
escape
(
project
.
name_with_namespace
)
}
</a>
</li>
`
,
...
...
changelogs/unreleased/security_issue_42029.yml
0 → 100644
View file @
bf86fba0
---
title
:
Sanitizes user name to avoid XSS attacks
merge_request
:
author
:
type
:
security
spec/javascripts/sidebar/mock_data.js
View file @
bf86fba0
...
...
@@ -130,7 +130,7 @@ const RESPONSE_MAP = {
'name_with_namespace'
:
'No project'
,
},
{
'id'
:
20
,
'name_with_namespace'
:
'foo / bar'
,
'name_with_namespace'
:
'
<img src=x onerror=alert(document.domain)>
foo / bar'
,
},
],
},
...
...
spec/javascripts/sidebar/sidebar_move_issue_spec.js
View file @
bf86fba0
...
...
@@ -68,6 +68,15 @@ describe('SidebarMoveIssue', () => {
expect
(
$
.
fn
.
glDropdown
).
toHaveBeenCalled
();
});
it
(
'escapes html from project name'
,
(
done
)
=>
{
this
.
$toggleButton
.
dropdown
(
'toggle'
);
setTimeout
(()
=>
{
expect
(
this
.
$content
.
find
(
'.js-move-issue-dropdown-item'
)[
1
].
innerHTML
.
trim
()).
toEqual
(
'<img src=x onerror=alert(document.domain)> foo / bar'
);
done
();
});
});
});
describe
(
'onConfirmClicked'
,
()
=>
{
...
...
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