Require PKCE for public clients that register at /oauth/register
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- php
- Domain
- authentication, security
Research direction
Read modules/simple_oauth_client_registration/src/Service/ClientRegistrationService.php, especially lines 96 to 117, and check how registration sets the consumer's pkce field for clients using token_endpoint_auth_method: none. Verify that public client registration enables PKCE without requiring simple_oauth_pkce; done means the registered client requires a code challenge during authorization.
Written by the indexing model from the issue text.
Description
Problem
ClientRegistrationService does not set the pkce field of the consumer (modules/simple_oauth_client_registration/src/Service/ClientRegistrationService.php, lines 96 to 117). The field is FALSE by default, and simple_oauth then does not require a code challenge for a public client.
simple_oauth_pkce is not a dependency of simple_oauth_client_registration. Without it, a client that registers with token_endpoint_auth_method: none completes the authorization code flow without a code challenge and without a code verifier. A party that intercepts the authorization code can redeem it with only the client identifier.
The README says "Mandatory PKCE" for all authorization code flows (README.md, line 15).
Expected Behavior
Registration sets pkce to TRUE for a public client, so that simple_oauth requires a code challenge. The result does not depend on simple_oauth_pkce.
Steps to Reproduce
- Install
simple_oauth_client_registrationwithoutsimple_oauth_pkce. Create a scopeexample:readfor the authorization code grant. - Send
POST /oauth/registerwith the JSON body{"client_name": "Native app", "token_endpoint_auth_method": "none", "application_type": "native", "redirect_uris": ["com.example.app://callback"]}. - A user with
grant simple_oauth codesopens/oauth/authorizewithresponse_type=code, theclient_id, theredirect_uriandscope=example:read. The request has nocode_challenge. The user presses "Allow". - Send
POST /oauth/tokenwithgrant_type=authorization_code, theclient_id, theredirect_uriand thecode. The request has nocode_verifier. The response is 200 with an access token.
Additional Context
https://git.drupalcode.org/project/simple_oauth/-/work_items/3636064 asks for a safer default in simple_oauth. Found on v2.1.1.
- Dominant language
- JavaScript
- Stars
- 6
- Forks
- 9
- Avg merge
- 9h 41m
- Merged PRs (30d)
- 15
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from e0ipso/simple_oauth_21
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
e0ipso/simple_oauth_21#63 ·
Maintainers usually reply within 1 day
-
category::bug code priority::normal
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
e0ipso/simple_oauth_21#58 ·
Maintainers usually reply within 1 day
-
category::bug code priority::minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
e0ipso/simple_oauth_21#54 ·
Maintainers usually reply within 1 day
-
category::bug code priority::minor
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
e0ipso/simple_oauth_21#53 ·
Maintainers usually reply within 1 day
-
category::bug code priority::minor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
e0ipso/simple_oauth_21#52 ·
Maintainers usually reply within 1 day
All issues in e0ipso/simple_oauth_21
Similar issues
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
Jason-Vaughan/TangleClaw#3270 ·
Maintainers usually reply within 1 day
-
docs
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
open-telemetry/opentelemetry.io#12846 ·
Maintainers usually reply within 1 day
-
Beginner Enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
JSPrismarine/JSPrismarine#3740 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 88/100
xdelmo/Portfolio-minimal#637 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
angrymrt/wiskunde-fit#242 ·
Maintainers usually reply within 1 day