-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Authentication Bypass in GraphQL Queries for Users/Tokens Lacking Permissions #16292
Comments
@arthanson, I was running 4.0.2, but pulled new image, and via API/UI, I do see version 4.0.3: unit@45f666ac0bd0:/opt/netbox$ head -3 docs/release-notes/version-4.0.md
# NetBox v4.0
## v4.0.3 (2024-05-22) docker image inspect f876940be42f | jq -r '.[].Config.Labels."netbox.git-ref"'
3f345cdbee016243ab5162456ea5415472a2f2df Should I rely on those versions or do we have a better (more reliable) way to check it? I've destroyed the environment, and recreated to see if there wasn't left overs from the old build, but still the same. |
I just tested this. I am not able to reproduce. Please provide more comprehensive steps including what objects to create for testing against (I see you are querying ASN's but I don't see how to create that ASN specifically) |
@DanSheps , thanks for checking, follow the step by step:
Here, I can get data without permissions set to the user:
If I try to get user details with the token without permissions, I do see a reject:
Using a superuser token, just to show the current permissions and tokens:
Thanks, and please let me know if you need something else. |
Hi, I noticed that I left write enable during the latest test, follow the result with write_enable as false for the test token in the same environment/deploy:
|
This is a reminder that additional information is needed in order to further triage this issue. If the requested details are not provided, the issue will soon be closed automatically. |
Alright, The fundamental issue is that for a single ASN query, we have:
the |
Deployment Type
Self-hosted
NetBox Version
v4.0.3
Python Version
3.11
Steps to Reproduce
Test user does not have any permissions associated with it (I am using the admin token to make the query):
Test user token:
Now using the test user token without any permissions via Graphql:
In my understanding, if a user/token has no permissions, it should reject by default.
Version:
This may be related with the issue#16228.
Expected Behavior
The system should reject GraphQL queries from users or tokens that do not have the necessary permissions.
Observed Behavior
During testing, it was discovered that if a user or token lacks permissions, the system does not enforce authentication for GraphQL queries. This was observed using a test user with no permissions, where GraphQL queries still returned sensitive data.
GraphQL queries are processed and data is returned even when the user or token has no permissions.
Further investigation is needed to confirm the scope and cause of the authentication bypass. Additional details will be provided upon request.
The text was updated successfully, but these errors were encountered: