RTDEV-61004 - Take the evidence created by user from the token#9
Closed
selalererjfrog wants to merge 1 commit intomainfrom
Closed
RTDEV-61004 - Take the evidence created by user from the token#9selalererjfrog wants to merge 1 commit intomainfrom
selalererjfrog wants to merge 1 commit intomainfrom
Conversation
alenon
requested changes
Sep 21, 2025
| func (c *createEvidenceBase) getUser() string { | ||
| user := auth.ExtractUsernameFromAccessToken(c.serverDetails.AccessToken) | ||
| if user == "" { | ||
| user = EvdDefaultUser |
Collaborator
There was a problem hiding this comment.
I think we should first fall-back the user from serverDetails and only after to the default one
user := c.serverDetails.User
if user == "" {
user = EvdDefaultUser
}
Author
There was a problem hiding this comment.
The ticket complains about us taking the user from the config even though it is not an authenticated user.
Evidence can't be created anyway with user/password authentication, so the only valid place to take the user is from the token
| assert.Equal(t, "abc123", st.Subject[0].Digest.Sha256) | ||
| assert.Equal(t, "hello", st.Markdown) | ||
| assert.Equal(t, "alice", st.CreatedBy) | ||
| assert.Equal(t, "moshe", st.CreatedBy) |
Collaborator
There was a problem hiding this comment.
what's wrong with alice? :))
Author
There was a problem hiding this comment.
It's not what I have in this token :-)
2559073 to
6a60c00
Compare
Contributor
mnsboev
approved these changes
Sep 21, 2025
Author
|
After discussion with Yevdo, this might not be a good place to solve this security concern |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Pull Request Template
Description
Fixed security issue where user in the CLI config file is displayed as the user that created the evidence regardless of who is logged in.
Testing
Checklist