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
d5c858cd
Commit
d5c858cd
authored
Feb 08, 2019
by
Alessio Caiazza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent Releases links API to leak tag existance
parent
a6794a27
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
changelogs/unreleased/security-tags-oracle.yml
changelogs/unreleased/security-tags-oracle.yml
+5
-0
lib/api/release/links.rb
lib/api/release/links.rb
+2
-0
spec/requests/api/release/links_spec.rb
spec/requests/api/release/links_spec.rb
+16
-0
No files found.
changelogs/unreleased/security-tags-oracle.yml
0 → 100644
View file @
d5c858cd
---
title
:
Prevent releases links API to leak tag existance
merge_request
:
author
:
type
:
security
lib/api/release/links.rb
View file @
d5c858cd
...
@@ -8,6 +8,8 @@ module API
...
@@ -8,6 +8,8 @@ module API
RELEASE_ENDPOINT_REQUIREMETS
=
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
RELEASE_ENDPOINT_REQUIREMETS
=
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
.
merge
(
tag_name:
API
::
NO_SLASH_URL_PART_REGEX
)
.
merge
(
tag_name:
API
::
NO_SLASH_URL_PART_REGEX
)
before
{
authorize!
:read_release
,
user_project
}
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
...
...
spec/requests/api/release/links_spec.rb
View file @
d5c858cd
...
@@ -73,6 +73,22 @@ describe API::Release::Links do
...
@@ -73,6 +73,22 @@ describe API::Release::Links do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
end
end
context
'when project is public and the repository is private'
do
let
(
:project
)
{
create
(
:project
,
:repository
,
:public
,
:repository_private
)
}
it_behaves_like
'403 response'
do
let
(
:request
)
{
get
api
(
"/projects/
#{
project
.
id
}
/releases/v0.1/assets/links"
,
non_project_member
)
}
end
context
'when the release does not exists'
do
let!
(
:release
)
{
}
it_behaves_like
'403 response'
do
let
(
:request
)
{
get
api
(
"/projects/
#{
project
.
id
}
/releases/v0.1/assets/links"
,
non_project_member
)
}
end
end
end
end
end
end
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