Lack of Scope Validation for client_credentials grant type

Open
#3,374 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java

Research direction

Start in UaaTokenServices#createAccessToken and trace the client_credentials path, comparing it with password and authorization_code scope handling. The change is complete when requested scopes are validated against the identity zone before token issuance and invalid or misconfigured scopes cannot appear in the issued token.

Written by the indexing model from the issue text.

Description

Unlike the password or authorization_code grant types, which validate user authorities before issuing a token, the client_credentials grant type in Cloud Foundry UAA does not validate whether the requested scopes exist in the system. Instead, UAA simply includes the scopes in the issued token as long as they match those configured for the client.

Problem Statement:
Currently, UAA does not enforce scope validation against a central authority list. This means:

  • If an admin assigns a non-existent or incorrectly configured scope to a client, UAA will still issue a token containing that scope.
  • There is no validation to ensure that the scopes assigned to the client are actually valid within the identity zone.
  • This could lead to misconfigurations where services rely on scopes that are not properly enforced, creating potential security risks.

Proposed Solution:
Modify UaaTokenServices#createAccessToken to introduce scope validation for client_credentials tokens. Specifically:
Before issuing a token, UAA can check that all requested scopes exist and are valid within the respective identity zone.

Expected Outcome:
Prevents issuance of tokens with non-existent or misconfigured scopes.
Enhances security by ensuring only valid scopes are granted to clients.
.

Dominant language
Java
Stars
1.6k
Forks
847
Avg merge
2d 1h
Merged PRs (30d)
48

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudfoundry/uaa

All issues in cloudfoundry/uaa

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.