-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #11794 Admins Cannot View Encrypted Field #13295
Fixed #11794 Admins Cannot View Encrypted Field #13295
Conversation
PR Summary
|
My expectation here would be that if you have the ability to edit an asset (and therefore edit the encrypted custom field) you should be able to see the value of that field. |
@snipe So instead of looking the roles I should look for the correct permissions? or in addition to the roles I need to check permissions? |
That's an excellent question.
snipe-it/resources/views/hardware/edit.blade.php Lines 76 to 93 in 74a5bcd
The problem here is that we're being inconsistent with the gating. If only superusers should be able to see encrypted custom fields in a list view or detail view, they should be the only ones that can edit them as well. However, this will likely break existing functionality. We do check for that gate in the API responses:
Stupidly, we check for snipe-it/resources/views/models/custom_fields_form.blade.php Lines 56 to 60 in 74a5bcd
Maybe we should add "view/edit encrypted fields" as an asset permission? It would mean a larger changeset but might be worth considering. My concern would potentially be that if ONLY superusers could see this before, it could potentially create a privilege escalation issue. Meaning, a "regular user" who is allowed to manage users but is not a superadmin could potentially allow asset managers who are not super admins to see data they previously could not. 🤔 snipe-it/resources/views/hardware/view.blade.php Lines 474 to 485 in 74a5bcd
@uberbrady do you have any additional thoughts here? (I know we've been workshopping this together offline just now.) My thoughts here:
I consider this a security bug actually, so I'd consider it higher priority than anything else on deck. If you think you can't tackle this today, let me know and I'll pick it up. |
I think it now works as expected, let me know if something with the defined gate is not correct because I had a lot of fight and don't know if I created it correctly. Thanks for your patience! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming this is the direction we want to go in: this looks good and works 😄
Another kind ping @snipe |
Description
Add permission to 'admin' roles to see encrypted fields values when looking for an asset (
AssetsTransformer
), and when viewing the details of a determined asset (resources/views/hardware/view.blade.php
).Fixes #11794
Type of change
How Has This Been Tested?
Test Configuration: