Skip to content
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

User and group queries are not properly restricted via GraphQL API #7814

Closed
jeremystretch opened this issue Nov 12, 2021 · 1 comment
Closed
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@jeremystretch
Copy link
Member

NetBox version

v3.0.9

Python version

3.8

Steps to Reproduce

  1. Log into NetBox as a user without permission to view user or group objects
  2. Navigate to the GraphQL API view (/graphql/)
  3. Enter the following query:
query {
    user_list
     {
      username
      password
    }
  }

Expected Behavior

The query should return an empty list due to insufficient permissions.

Observed Behavior

The results are not filtered. This is due to a missing call to restrict() on the queryset for these models. (These models are provided by the Django framework, so they're handled a bit differently than native NetBox models.)

@jeremystretch jeremystretch added type: bug A confirmed report of unexpected behavior in the application status: accepted This issue has been accepted for implementation labels Nov 12, 2021
@jeremystretch jeremystretch self-assigned this Nov 12, 2021
@jeremystretch
Copy link
Member Author

This will be fixed in the next release (v3.0.10). To address any potential security issues in the interim, NetBox administrators have the option of disabling the GraphQL API entirely by setting GRAPHQL_ENABLED = False in configuration.py. Alternatively, you can apply the patch from daf6c8e manually.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

1 participant