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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
c33ceff6
Commit
c33ceff6
authored
Sep 01, 2017
by
Tim Zallmann
Committed by
Jose Ivan Vargas
Sep 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes vulnerability in posting a comment in the temporary rendering
parent
1e878fd7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+4
-4
spec/javascripts/notes_spec.js
spec/javascripts/notes_spec.js
+15
-0
No files found.
app/assets/javascripts/notes.js
View file @
c33ceff6
...
...
@@ -1274,16 +1274,16 @@ export default class Notes {
`<li id="
${
uniqueId
}
" class="note being-posted fade-in-half timeline-entry">
<div class="timeline-entry-inner">
<div class="timeline-icon">
<a href="/
${
currentUsername
}
">
<a href="/
${
_
.
escape
(
currentUsername
)
}
">
<img class="avatar s40" src="
${
currentUserAvatar
}
" />
</a>
</div>
<div class="timeline-content
${
discussionClass
}
">
<div class="note-header">
<div class="note-header-info">
<a href="/
${
currentUsername
}
">
<span class="hidden-xs">
${
currentUserFullname
}
</span>
<span class="note-headline-light">@
${
currentUsername
}
</span>
<a href="/
${
_
.
escape
(
currentUsername
)
}
">
<span class="hidden-xs">
${
_
.
escape
(
currentUserFullname
)
}
</span>
<span class="note-headline-light">@
${
_
.
escape
(
currentUsername
)
}
</span>
</a>
</div>
</div>
...
...
spec/javascripts/notes_spec.js
View file @
c33ceff6
...
...
@@ -768,6 +768,21 @@ import '~/notes';
expect
(
$tempNote
.
prop
(
'
nodeName
'
)).
toEqual
(
'
LI
'
);
expect
(
$tempNote
.
find
(
'
.timeline-content
'
).
hasClass
(
'
discussion
'
)).
toBeTruthy
();
});
it
(
'
should return a escaped user name
'
,
()
=>
{
const
currentUserNameXSS
=
'
Foo <script>alert("XSS")</script>
'
;
const
$tempNote
=
this
.
notes
.
createPlaceholderNote
({
formContent
:
sampleComment
,
uniqueId
,
isDiscussionNote
:
false
,
currentUsername
,
currentUserNameXSS
,
currentUserAvatar
,
});
const
$tempNoteHeader
=
$tempNote
.
find
(
'
.note-header
'
);
expect
(
$tempNoteHeader
.
find
(
'
.hidden-xs
'
).
text
().
trim
()).
toEqual
(
'
Foo <script>alert("XSS")</script>
'
);
});
});
describe
(
'
createPlaceholderSystemNote
'
,
()
=>
{
...
...
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