Fix unauthorized field exposure in asset responses#25905
Merged
AlexGaillard merged 55 commits intomainfrom Jan 12, 2026
Merged
Conversation
…d-even-when-access-policy
Member
There was a problem hiding this comment.
Unfortunately the current approach leads to a few issues:
- It introduces a breaking change by requiring explicit permission for fields that are essential
- There's no clear guidance on which fields are minimally required
- It forces users to grant access to fields they wouldn’t typically allow
Ideally we have a way to query as an admin but return the data as the if the user queried
br41nslug
reviewed
Oct 8, 2025
Member
br41nslug
left a comment
There was a problem hiding this comment.
Got some type nitpicks for you 😬 hopefully those get rid of some reliance on the any type.
Will have to look at this again with some fresh eyes to properly wrap my head around the fix here 😵
api/src/permissions/modules/validate-access/lib/validate-item-access.ts
Outdated
Show resolved
Hide resolved
api/src/permissions/modules/validate-access/lib/validate-item-access.ts
Outdated
Show resolved
Hide resolved
api/src/permissions/modules/validate-access/lib/validate-item-access.ts
Outdated
Show resolved
Hide resolved
api/src/permissions/modules/validate-access/lib/validate-item-access.ts
Outdated
Show resolved
Hide resolved
api/src/permissions/modules/validate-access/lib/validate-item-access.ts
Outdated
Show resolved
Hide resolved
api/src/permissions/modules/validate-access/lib/validate-item-access.test.ts
Outdated
Show resolved
Hide resolved
…d-even-when-access-policy
…lds for improved permission handling
…proved readability
…ermissions for improved accuracy
…for improved access validation
… ast.children when no item rules
…d-even-when-access-policy
…d-even-when-access-policy
ComfortablyCoding
approved these changes
Jan 12, 2026
AlexGaillard
approved these changes
Jan 12, 2026
3 tasks
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.
Scope
What's changed:
AssetsServicenow respects field-level permissions when serving assetsreturnAllowedRootFieldsoption in validateItemAccess to retrieve accessible fields in a single database queryPotential Risks / Drawbacks
Tested Scenarios
Checklist
Fixes #24057