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
74e87653
Commit
74e87653
authored
Jan 14, 2021
by
GitLab Release Tools Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'dev/master'
parents
534b0be4
4d89e6a2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
25 deletions
+64
-25
CHANGELOG-EE.md
CHANGELOG-EE.md
+12
-0
CHANGELOG.md
CHANGELOG.md
+21
-0
app/controllers/oauth/authorizations_controller.rb
app/controllers/oauth/authorizations_controller.rb
+12
-11
spec/controllers/oauth/authorizations_controller_spec.rb
spec/controllers/oauth/authorizations_controller_spec.rb
+19
-14
No files found.
CHANGELOG-EE.md
View file @
74e87653
Please view this file on the master branch, on stable branches it's out of date.
Please view this file on the master branch, on stable branches it's out of date.
## 13.7.4 (2021-01-13)
-
No changes.
## 13.7.3 (2021-01-08)
## 13.7.3 (2021-01-08)
-
No changes.
-
No changes.
...
@@ -170,6 +174,10 @@ Please view this file on the master branch, on stable branches it's out of date.
...
@@ -170,6 +174,10 @@ Please view this file on the master branch, on stable branches it's out of date.
-
Rename code coverage analytics sections. !49931
-
Rename code coverage analytics sections. !49931
## 13.6.5 (2021-01-13)
-
No changes.
## 13.6.4 (2021-01-07)
## 13.6.4 (2021-01-07)
-
No changes.
-
No changes.
...
@@ -369,6 +377,10 @@ Please view this file on the master branch, on stable branches it's out of date.
...
@@ -369,6 +377,10 @@ Please view this file on the master branch, on stable branches it's out of date.
-
Remove duplicated BS display properties from member overriding UI. !47126 (Takuya Noguchi)
-
Remove duplicated BS display properties from member overriding UI. !47126 (Takuya Noguchi)
## 13.5.7 (2021-01-13)
-
No changes.
## 13.5.6 (2021-01-07)
## 13.5.6 (2021-01-07)
-
No changes.
-
No changes.
...
...
CHANGELOG.md
View file @
74e87653
...
@@ -2,6 +2,13 @@
...
@@ -2,6 +2,13 @@
documentation
](
doc/development/changelog.md
)
for instructions on adding your own
documentation
](
doc/development/changelog.md
)
for instructions on adding your own
entry.
entry.
## 13.7.4 (2021-01-13)
### Security (1 change)
-
Deny implicit flow for confidential apps.
## 13.7.3 (2021-01-08)
## 13.7.3 (2021-01-08)
### Fixed (7 changes)
### Fixed (7 changes)
...
@@ -497,6 +504,13 @@ entry.
...
@@ -497,6 +504,13 @@ entry.
-
Update GitLab Workhorse to v8.57.0.
-
Update GitLab Workhorse to v8.57.0.
## 13.6.5 (2021-01-13)
### Security (1 change)
-
Deny implicit flow for confidential apps.
## 13.6.4 (2021-01-07)
## 13.6.4 (2021-01-07)
### Security (7 changes)
### Security (7 changes)
...
@@ -1068,6 +1082,13 @@ entry.
...
@@ -1068,6 +1082,13 @@ entry.
-
Change wording on the project remove fork page. !47878
-
Change wording on the project remove fork page. !47878
## 13.5.7 (2021-01-13)
### Security (1 change)
-
Deny implicit flow for confidential apps.
## 13.5.6 (2021-01-07)
## 13.5.6 (2021-01-07)
### Security (7 changes)
### Security (7 changes)
...
...
app/controllers/oauth/authorizations_controller.rb
View file @
74e87653
...
@@ -4,7 +4,7 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
...
@@ -4,7 +4,7 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
include
Gitlab
::
Experimentation
::
ControllerConcern
include
Gitlab
::
Experimentation
::
ControllerConcern
include
InitializesCurrentUserMode
include
InitializesCurrentUserMode
before_action
:verify_confirmed_email!
before_action
:verify_confirmed_email!
,
:verify_confidential_application!
layout
'profile'
layout
'profile'
...
@@ -24,18 +24,19 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
...
@@ -24,18 +24,19 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
end
end
end
end
def
create
private
# Confidential apps require the client_secret to be sent with the request.
# Doorkeeper allows implicit grant flow requests (response_type=token) to
# Confidential apps require the client_secret to be sent with the request.
# work without client_secret regardless of the confidential setting.
# Doorkeeper allows implicit grant flow requests (response_type=token) to
if
pre_auth
.
authorizable?
&&
pre_auth
.
response_type
==
'token'
&&
pre_auth
.
client
.
application
.
confidential
# work without client_secret regardless of the confidential setting.
render
"doorkeeper/authorizations/error"
# This leads to security vulnerabilities and we want to block it.
else
def
verify_confidential_application!
super
render
'doorkeeper/authorizations/error'
if
authorizable_confidential?
end
end
end
private
def
authorizable_confidential?
pre_auth
.
authorizable?
&&
pre_auth
.
response_type
==
'token'
&&
pre_auth
.
client
.
application
.
confidential
end
def
verify_confirmed_email!
def
verify_confirmed_email!
return
if
current_user
&
.
confirmed?
return
if
current_user
&
.
confirmed?
...
...
spec/controllers/oauth/authorizations_controller_spec.rb
View file @
74e87653
...
@@ -51,10 +51,27 @@ RSpec.describe Oauth::AuthorizationsController do
...
@@ -51,10 +51,27 @@ RSpec.describe Oauth::AuthorizationsController do
end
end
end
end
shared_examples
"Implicit grant can't be used in confidential application"
do
context
'when application is confidential'
do
before
do
application
.
update
(
confidential:
true
)
params
[
:response_type
]
=
'token'
end
it
'does not allow the implicit flow'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
render_template
(
'doorkeeper/authorizations/error'
)
end
end
end
describe
'GET #new'
do
describe
'GET #new'
do
subject
{
get
:new
,
params:
params
}
subject
{
get
:new
,
params:
params
}
include_examples
'OAuth Authorizations require confirmed user'
include_examples
'OAuth Authorizations require confirmed user'
include_examples
"Implicit grant can't be used in confidential application"
context
'when the user is confirmed'
do
context
'when the user is confirmed'
do
let
(
:confirmed_at
)
{
1
.
hour
.
ago
}
let
(
:confirmed_at
)
{
1
.
hour
.
ago
}
...
@@ -95,26 +112,14 @@ RSpec.describe Oauth::AuthorizationsController do
...
@@ -95,26 +112,14 @@ RSpec.describe Oauth::AuthorizationsController do
subject
{
post
:create
,
params:
params
}
subject
{
post
:create
,
params:
params
}
include_examples
'OAuth Authorizations require confirmed user'
include_examples
'OAuth Authorizations require confirmed user'
include_examples
"Implicit grant can't be used in confidential application"
context
'when application is confidential'
do
before
do
application
.
update
(
confidential:
true
)
params
[
:response_type
]
=
'token'
end
it
'does not allow the implicit flow'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
render_template
(
'doorkeeper/authorizations/error'
)
end
end
end
end
describe
'DELETE #destroy'
do
describe
'DELETE #destroy'
do
subject
{
delete
:destroy
,
params:
params
}
subject
{
delete
:destroy
,
params:
params
}
include_examples
'OAuth Authorizations require confirmed user'
include_examples
'OAuth Authorizations require confirmed user'
include_examples
"Implicit grant can't be used in confidential application"
end
end
it
'includes Two-factor enforcement concern'
do
it
'includes Two-factor enforcement concern'
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