Return 404 when unauthorised to access resources#1494
Open
Callum027 wants to merge 1 commit intognocchixyz:masterfrom
Open
Return 404 when unauthorised to access resources#1494Callum027 wants to merge 1 commit intognocchixyz:masterfrom
Callum027 wants to merge 1 commit intognocchixyz:masterfrom
Conversation
dc91177 to
018fe3b
Compare
35183d8 to
b40356f
Compare
When a user is not authorised to access a specific resource (e.g. did not create the resource, or not part of the project that owns the resource, or the project that created the resource), they should not be able to enumerate the resource in any way. To prevent such users from inferring the existence of resources they should not have access to, change the policy enforcement for `get resource` such that it returns `404 Not Found` instead of `403 Forbidden` in these cases.
b40356f to
77b7fbf
Compare
| } | ||
|
|
||
| @staticmethod | ||
| def enforce_resource_policy(request, |
Contributor
There was a problem hiding this comment.
I think we need some logging in this method. This would help us when troubleshooting issues. I mean, so operators can easily spot such situations. The logs can be in DEBUG level, in my opinion.
tobias-urdin
approved these changes
Apr 10, 2026
Contributor
tobias-urdin
left a comment
There was a problem hiding this comment.
LGTM, let me know if it's good to merge
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.
When a user is not authorised to access a specific resource (e.g. did not create the resource, or not part of the project that owns the resource, or the project that created the resource), they should not be able to enumerate the resource in any way.
To prevent such users from inferring the existence of resources they should not have access to, change the policy enforcement for
get resourcesuch that it returns404 Not Foundinstead of403 Forbiddenin these cases.