Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Greenlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arbeitsgruppe Hardwarenahe IT-Systeme
Greenlight
Commits
7c57f4b9
Unverified
Commit
7c57f4b9
authored
Oct 20, 2020
by
Ahmad Farhat
Committed by
GitHub
Oct 20, 2020
Browse files
Options
Downloads
Patches
Plain Diff
Fixed XSS vulnerability in merge user modal (#2214)
parent
ec4cde64
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/assets/javascripts/admins.js
+25
-5
25 additions, 5 deletions
app/assets/javascripts/admins.js
with
25 additions
and
5 deletions
app/assets/javascripts/admins.js
+
25
−
5
View file @
7c57f4b9
...
@@ -52,11 +52,19 @@ $(document).on('turbolinks:load', function(){
...
@@ -52,11 +52,19 @@ $(document).on('turbolinks:load', function(){
$
(
"
.merge-user
"
).
click
(
function
()
{
$
(
"
.merge-user
"
).
click
(
function
()
{
// Update the path of save button
// Update the path of save button
$
(
"
#merge-save-access
"
).
attr
(
"
data-path
"
,
$
(
this
).
data
(
"
path
"
))
$
(
"
#merge-save-access
"
).
attr
(
"
data-path
"
,
$
(
this
).
data
(
"
path
"
))
let
userInfo
=
$
(
this
).
data
(
"
info
"
)
let
userInfo
=
$
(
this
).
data
(
"
info
"
)
$
(
"
#merge-to
"
).
html
(
""
)
// Clear current inputs
$
(
"
#merge-to
"
).
html
(
"
<span>
"
+
userInfo
.
name
+
"
</span>
"
+
"
<span class='text-muted d-block'>
"
+
userInfo
.
email
+
"
</span>
"
+
"
<span class='text-muted d-block'>
"
+
userInfo
.
uid
+
"
</span>
"
)
let
spanName
=
document
.
createElement
(
"
span
"
),
spanEmail
=
document
.
createElement
(
"
span
"
),
spanUid
=
document
.
createElement
(
"
span
"
);
spanName
.
innerText
=
userInfo
.
name
spanEmail
.
setAttribute
(
'
class
'
,
'
text-muted d-block
'
)
spanEmail
.
innerText
=
userInfo
.
email
spanUid
.
setAttribute
(
'
class
'
,
'
text-muted d-block
'
)
spanUid
.
innerText
=
userInfo
.
uid
$
(
"
#merge-to
"
).
append
(
spanName
,
spanEmail
,
spanUid
)
})
})
$
(
"
#mergeUserModal
"
).
on
(
"
show.bs.modal
"
,
function
()
{
$
(
"
#mergeUserModal
"
).
on
(
"
show.bs.modal
"
,
function
()
{
...
@@ -81,7 +89,19 @@ $(document).on('turbolinks:load', function(){
...
@@ -81,7 +89,19 @@ $(document).on('turbolinks:load', function(){
let
user
=
$
(
"
.selectpicker
"
).
selectpicker
(
'
val
'
)
let
user
=
$
(
"
.selectpicker
"
).
selectpicker
(
'
val
'
)
if
(
user
!=
""
)
{
if
(
user
!=
""
)
{
let
userInfo
=
JSON
.
parse
(
user
)
let
userInfo
=
JSON
.
parse
(
user
)
$
(
"
#merge-from
"
).
html
(
"
<span>
"
+
userInfo
.
name
+
"
</span>
"
+
"
<span class='text-muted d-block'>
"
+
userInfo
.
email
+
"
</span>
"
+
"
<span id='from-uid' class='text-muted d-block'>
"
+
userInfo
.
uid
+
"
</span>
"
)
$
(
"
#merge-from
"
).
html
(
""
)
// Clear current input
let
spanName
=
document
.
createElement
(
"
span
"
),
spanEmail
=
document
.
createElement
(
"
span
"
),
spanUid
=
document
.
createElement
(
"
span
"
);
spanName
.
innerText
=
userInfo
.
name
spanEmail
.
setAttribute
(
'
class
'
,
'
text-muted d-block
'
)
spanEmail
.
innerText
=
userInfo
.
email
spanUid
.
setAttribute
(
'
class
'
,
'
text-muted d-block
'
)
spanUid
.
id
=
'
from-uid
'
spanUid
.
innerText
=
userInfo
.
uid
$
(
"
#merge-from
"
).
append
(
spanName
,
spanEmail
,
spanUid
)
}
}
})
})
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment