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
2f7b71df
Commit
2f7b71df
authored
Apr 18, 2018
by
Phil Hughes
Committed by
Mayra Cabrera
Apr 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch '10-7-security_issue_42029' into 'security-10-7'
Sanitize user name to avoid XSS attacks See merge request gitlab/gitlabhq!2373
parent
9cf4e473
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
2 deletions
+17
-2
sidebar_move_issue.js
app/assets/javascripts/sidebar/lib/sidebar_move_issue.js
+2
-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 @
2f7b71df
import
$
from
'jquery'
;
import
_
from
'underscore'
;
function
isValidProjectId
(
id
)
{
return
id
>
0
;
...
...
@@ -43,7 +44,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 @
2f7b71df
---
title
:
Sanitizes user name to avoid XSS attacks
merge_request
:
author
:
type
:
security
spec/javascripts/sidebar/mock_data.js
View file @
2f7b71df
...
...
@@ -138,7 +138,7 @@ const RESPONSE_MAP = {
},
{
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 @
2f7b71df
...
...
@@ -69,6 +69,15 @@ describe('SidebarMoveIssue', function () {
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