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
5a411b6e
Commit
5a411b6e
authored
Jan 13, 2020
by
Mayra Cabrera
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.com:gitlab-org/security/gitlab
parents
493c7ac8
74dcf9b4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
changelogs/unreleased/security-project-import-vn-master.yml
changelogs/unreleased/security-project-import-vn-master.yml
+5
-0
lib/gitlab/import_export/attribute_cleaner.rb
lib/gitlab/import_export/attribute_cleaner.rb
+2
-2
spec/lib/gitlab/import_export/attribute_cleaner_spec.rb
spec/lib/gitlab/import_export/attribute_cleaner_spec.rb
+13
-2
No files found.
changelogs/unreleased/security-project-import-vn-master.yml
0 → 100644
View file @
5a411b6e
---
title
:
Fix private objects exposure when using Project Import functionality
merge_request
:
author
:
type
:
security
lib/gitlab/import_export/attribute_cleaner.rb
View file @
5a411b6e
...
...
@@ -3,8 +3,8 @@
module
Gitlab
module
ImportExport
class
AttributeCleaner
ALLOWED_REFERENCES
=
RelationFactory
::
PROJECT_REFERENCES
+
RelationFactory
::
USER_REFERENCES
+
%w[group_id commit_id discussion_id]
PROHIBITED_REFERENCES
=
Regexp
.
union
(
/\Acached_markdown_version\Z/
,
/_id\Z/
,
/_ids\Z/
,
/_html\Z/
).
freeze
ALLOWED_REFERENCES
=
RelationFactory
::
PROJECT_REFERENCES
+
RelationFactory
::
USER_REFERENCES
+
%w[group_id commit_id discussion_id
custom_attributes
]
PROHIBITED_REFERENCES
=
Regexp
.
union
(
/\Acached_markdown_version\Z/
,
/_id\Z/
,
/_ids\Z/
,
/_html\Z/
,
/attributes/
).
freeze
def
self
.
clean
(
*
args
)
new
(
*
args
).
clean
...
...
spec/lib/gitlab/import_export/attribute_cleaner_spec.rb
View file @
5a411b6e
...
...
@@ -25,11 +25,21 @@ describe Gitlab::ImportExport::AttributeCleaner do
'legit_html'
=>
'<p>legit html</p>'
,
'_html'
=>
'<p>perfectly ordinary html</p>'
,
'cached_markdown_version'
=>
12345
,
'custom_attributes'
=>
'whatever'
,
'some_attributes_metadata'
=>
'whatever'
,
'group_id'
=>
99
,
'commit_id'
=>
99
,
'issue_ids'
=>
[
1
,
2
,
3
],
'merge_request_ids'
=>
[
1
,
2
,
3
],
'note_ids'
=>
[
1
,
2
,
3
]
'note_ids'
=>
[
1
,
2
,
3
],
'attributes'
=>
{
'issue_ids'
=>
[
1
,
2
,
3
],
'merge_request_ids'
=>
[
1
,
2
,
3
],
'note_ids'
=>
[
1
,
2
,
3
]
},
'variables_attributes'
=>
{
'id'
=>
1
}
}
end
...
...
@@ -40,7 +50,8 @@ describe Gitlab::ImportExport::AttributeCleaner do
'random_id_in_the_middle'
=>
99
,
'notid'
=>
99
,
'group_id'
=>
99
,
'commit_id'
=>
99
'commit_id'
=>
99
,
'custom_attributes'
=>
'whatever'
}
end
...
...
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