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
Boxiang Sun
gitlab-ce
Commits
e7aaada2
Commit
e7aaada2
authored
Jan 22, 2019
by
Dennis Tang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use sanitized user status message for user popover
parent
ae216618
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
app/assets/javascripts/vue_shared/components/user_popover/user_popover.vue
...ripts/vue_shared/components/user_popover/user_popover.vue
+4
-4
changelogs/unreleased/security-55320-stored-xss-in-user-status.yml
...s/unreleased/security-55320-stored-xss-in-user-status.yml
+5
-0
spec/javascripts/vue_shared/components/user_popover/user_popover_spec.js
...s/vue_shared/components/user_popover/user_popover_spec.js
+3
-3
No files found.
app/assets/javascripts/vue_shared/components/user_popover/user_popover.vue
View file @
e7aaada2
...
...
@@ -28,10 +28,10 @@ export default {
},
computed
:
{
statusHtml
()
{
if
(
this
.
user
.
status
.
emoji
&&
this
.
user
.
status
.
message
)
{
return
`
${
glEmojiTag
(
this
.
user
.
status
.
emoji
)}
${
this
.
user
.
status
.
message
}
`
;
}
else
if
(
this
.
user
.
status
.
message
)
{
return
this
.
user
.
status
.
message
;
if
(
this
.
user
.
status
.
emoji
&&
this
.
user
.
status
.
message
_html
)
{
return
`
${
glEmojiTag
(
this
.
user
.
status
.
emoji
)}
${
this
.
user
.
status
.
message
_html
}
`
;
}
else
if
(
this
.
user
.
status
.
message
_html
)
{
return
this
.
user
.
status
.
message
_html
;
}
return
''
;
},
...
...
changelogs/unreleased/security-55320-stored-xss-in-user-status.yml
0 → 100644
View file @
e7aaada2
---
title
:
Use sanitized user status message for user popover
merge_request
:
author
:
type
:
security
spec/javascripts/vue_shared/components/user_popover/user_popover_spec.js
View file @
e7aaada2
...
...
@@ -122,7 +122,7 @@ describe('User Popover Component', () => {
describe
(
'
status data
'
,
()
=>
{
it
(
'
should show only message
'
,
()
=>
{
const
testProps
=
Object
.
assign
({},
DEFAULT_PROPS
);
testProps
.
user
.
status
=
{
message
:
'
Hello World
'
};
testProps
.
user
.
status
=
{
message
_html
:
'
Hello World
'
};
vm
=
mountComponent
(
UserPopover
,
{
...
DEFAULT_PROPS
,
...
...
@@ -134,12 +134,12 @@ describe('User Popover Component', () => {
it
(
'
should show message and emoji
'
,
()
=>
{
const
testProps
=
Object
.
assign
({},
DEFAULT_PROPS
);
testProps
.
user
.
status
=
{
emoji
:
'
basketball_player
'
,
message
:
'
Hello World
'
};
testProps
.
user
.
status
=
{
emoji
:
'
basketball_player
'
,
message
_html
:
'
Hello World
'
};
vm
=
mountComponent
(
UserPopover
,
{
...
DEFAULT_PROPS
,
target
:
document
.
querySelector
(
'
.js-user-link
'
),
status
:
{
emoji
:
'
basketball_player
'
,
message
:
'
Hello World
'
},
status
:
{
emoji
:
'
basketball_player
'
,
message
_html
:
'
Hello World
'
},
});
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
Hello World
'
);
...
...
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