BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
0d8fba4e
Commit
0d8fba4e
authored
Apr 05, 2017
by
DJ Mountney
Committed by
DJ Mountney
Apr 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'path-disclosure-proj-import-export' into 'security'
Fix for path disclosure in project import/export See merge request !2080
parent
29d8b4ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
projects_helper.rb
app/helpers/projects_helper.rb
+4
-1
file-import-export-path-disclosure.yml
changelogs/unreleased/file-import-export-path-disclosure.yml
+5
-0
projects_helper_spec.rb
spec/helpers/projects_helper_spec.rb
+8
-0
No files found.
app/helpers/projects_helper.rb
View file @
0d8fba4e
...
...
@@ -407,7 +407,10 @@ module ProjectsHelper
def
sanitize_repo_path
(
project
,
message
)
return
''
unless
message
.
present?
message
.
strip
.
gsub
(
project
.
repository_storage_path
.
chomp
(
'/'
),
"[REPOS PATH]"
)
exports_path
=
File
.
join
(
Settings
.
shared
[
'path'
],
'tmp/project_exports'
)
filtered_message
=
message
.
strip
.
gsub
(
exports_path
,
"[REPO EXPORT PATH]"
)
filtered_message
.
gsub
(
project
.
repository_storage_path
.
chomp
(
'/'
),
"[REPOS PATH]"
)
end
def
project_feature_options
...
...
changelogs/unreleased/file-import-export-path-disclosure.yml
0 → 100644
View file @
0d8fba4e
---
title
:
Fix path disclosure in project import/export
merge_request
:
author
:
spec/helpers/projects_helper_spec.rb
View file @
0d8fba4e
...
...
@@ -167,6 +167,7 @@ describe ProjectsHelper do
before
do
allow
(
project
).
to
receive
(
:repository_storage_path
).
and_return
(
'/base/repo/path'
)
allow
(
Settings
.
shared
).
to
receive
(
:[]
).
with
(
'path'
).
and_return
(
'/base/repo/export/path'
)
end
it
'removes the repo path'
do
...
...
@@ -175,6 +176,13 @@ describe ProjectsHelper do
expect
(
sanitize_repo_path
(
project
,
import_error
)).
to
eq
(
'Could not clone [REPOS PATH]/namespace/test.git'
)
end
it
'removes the temporary repo path used for uploads/exports'
do
repo
=
'/base/repo/export/path/tmp/project_exports/uploads/test.tar.gz'
import_error
=
"Unable to decompress
#{
repo
}
\n
"
expect
(
sanitize_repo_path
(
project
,
import_error
)).
to
eq
(
'Unable to decompress [REPO EXPORT PATH]/uploads/test.tar.gz'
)
end
end
describe
'#last_push_event'
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