Skip to content

fix reference token privilege escalation#3410

Open
reshmifrog wants to merge 1 commit intojfrog:masterfrom
reshmifrog:fix/reference-token-privilege-escalation
Open

fix reference token privilege escalation#3410
reshmifrog wants to merge 1 commit intojfrog:masterfrom
reshmifrog:fix/reference-token-privilege-escalation

Conversation

@reshmifrog
Copy link
Copy Markdown
Contributor

  • All tests have passed. If this feature is not already covered by the tests, new tests have been added.
  • The pull request is targeting the master branch.
  • The code has been validated to compile successfully by running go vet ./....
  • The code has been formatted properly using go fmt ./....

Problem: When a reference token with restricted scope (e.g., Viewer) is used as --password in jf c add, the CLI's automatic token refresh creates a new token with scope=member-of-groups:*, escalating to the user's full permissions.
Solution: The fix auto-detects reference tokens by their stable base64 prefix (cmVmdGtuOj = reftkn:) and disables the token refresh mechanism, preserving the token's restricted scope.

@reshmifrog reshmifrog added the bug Something isn't working label Mar 31, 2026
@reshmifrog reshmifrog added the safe to test Approve running integration tests on a pull request label Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working safe to test Approve running integration tests on a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant