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
Léo-Paul Géneau
gitlab-ce
Commits
0169dd7f
Commit
0169dd7f
authored
Sep 15, 2017
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes project denial of service via gitmodules using Extended ASCII.
parent
5d3f7b13
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
4 deletions
+19
-4
app/helpers/submodule_helper.rb
app/helpers/submodule_helper.rb
+8
-4
changelogs/unreleased/34259-project-denial-of-service-via-gitmodules-fix.yml
...ed/34259-project-denial-of-service-via-gitmodules-fix.yml
+5
-0
spec/helpers/submodule_helper_spec.rb
spec/helpers/submodule_helper_spec.rb
+6
-0
No files found.
app/helpers/submodule_helper.rb
View file @
0169dd7f
...
@@ -87,10 +87,14 @@ module SubmoduleHelper
...
@@ -87,10 +87,14 @@ module SubmoduleHelper
namespace
=
@project
.
namespace
.
full_path
namespace
=
@project
.
namespace
.
full_path
end
end
[
begin
namespace_project_path
(
namespace
,
base
),
[
namespace_project_tree_path
(
namespace
,
base
,
commit
)
namespace_project_path
(
namespace
,
base
),
]
namespace_project_tree_path
(
namespace
,
base
,
commit
)
]
rescue
ActionController
::
UrlGenerationError
[
nil
,
nil
]
end
end
end
def
sanitize_submodule_url
(
url
)
def
sanitize_submodule_url
(
url
)
...
...
changelogs/unreleased/34259-project-denial-of-service-via-gitmodules-fix.yml
0 → 100644
View file @
0169dd7f
---
title
:
Fixes project denial of service via gitmodules using Extended ASCII.
merge_request
:
14301
author
:
type
:
fixed
spec/helpers/submodule_helper_spec.rb
View file @
0169dd7f
...
@@ -147,6 +147,12 @@ describe SubmoduleHelper do
...
@@ -147,6 +147,12 @@ describe SubmoduleHelper do
expect
(
helper
.
submodule_links
(
submodule_item
)).
to
eq
([
nil
,
nil
])
expect
(
helper
.
submodule_links
(
submodule_item
)).
to
eq
([
nil
,
nil
])
end
end
it
'sanitizes invalid URL with extended ASCII'
do
stub_url
(
'é'
)
expect
(
helper
.
submodule_links
(
submodule_item
)).
to
eq
([
nil
,
nil
])
end
it
'returns original'
do
it
'returns original'
do
stub_url
(
'http://mygitserver.com/gitlab-org/gitlab-ce'
)
stub_url
(
'http://mygitserver.com/gitlab-org/gitlab-ce'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
...
...
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