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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
8435cf31
Commit
8435cf31
authored
Mar 20, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
48063e7b
c7fc0bf5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
1 deletion
+44
-1
CHANGELOG.md
CHANGELOG.md
+7
-0
app/controllers/concerns/notes_actions.rb
app/controllers/concerns/notes_actions.rb
+1
-1
changelogs/unreleased/security-2826-fix-project-serialization-in-quick-actions.yml
...urity-2826-fix-project-serialization-in-quick-actions.yml
+5
-0
spec/controllers/projects/notes_controller_spec.rb
spec/controllers/projects/notes_controller_spec.rb
+31
-0
No files found.
CHANGELOG.md
View file @
8435cf31
...
...
@@ -2,6 +2,13 @@
documentation
](
doc/development/changelog.md
)
for instructions on adding your own
entry.
## 11.8.3 (2019-03-19)
### Security (1 change)
-
Remove project serialization in quick actions response.
## 11.8.2 (2019-03-13)
### Security (1 change)
...
...
app/controllers/concerns/notes_actions.rb
View file @
8435cf31
...
...
@@ -48,7 +48,7 @@ module NotesActions
respond_to
do
|
format
|
format
.
json
do
json
=
{
commands_changes:
@note
.
commands_changes
commands_changes:
@note
.
commands_changes
&
.
slice
(
:emoji_award
,
:time_estimate
,
:spend_time
)
}
if
@note
.
persisted?
&&
return_discussion?
...
...
changelogs/unreleased/security-2826-fix-project-serialization-in-quick-actions.yml
0 → 100644
View file @
8435cf31
---
title
:
Remove project serialization in quick actions response
merge_request
:
author
:
type
:
security
spec/controllers/projects/notes_controller_spec.rb
View file @
8435cf31
...
...
@@ -413,6 +413,37 @@ describe Projects::NotesController do
end
end
end
context
'when creating a note with quick actions'
do
context
'with commands that return changes'
do
let
(
:note_text
)
{
"/award :thumbsup:
\n
/estimate 1d
\n
/spend 3h"
}
it
'includes changes in commands_changes '
do
post
:create
,
params:
request_params
.
merge
(
note:
{
note:
note_text
},
format: :json
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
'commands_changes'
]).
to
include
(
'emoji_award'
,
'time_estimate'
,
'spend_time'
)
expect
(
json_response
[
'commands_changes'
]).
not_to
include
(
'target_project'
,
'title'
)
end
end
context
'with commands that do not return changes'
do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:other_project
)
{
create
(
:project
)
}
let
(
:note_text
)
{
"/move
#{
other_project
.
full_path
}
\n
/title AAA"
}
before
do
other_project
.
add_developer
(
user
)
end
it
'does not include changes in commands_changes'
do
post
:create
,
params:
request_params
.
merge
(
note:
{
note:
note_text
},
target_type:
'issue'
,
target_id:
issue
.
id
,
format: :json
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
'commands_changes'
]).
not_to
include
(
'target_project'
,
'title'
)
end
end
end
end
describe
'PUT update'
do
...
...
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