Skip to content

GraphQL API returns all object if given filter is invalid #16946

@valentinesd

Description

@valentinesd

Deployment Type

Self-hosted

NetBox Version

v4.0.7

Python Version

3.10

Steps to Reproduce

My specific use case is vlan_list filtered by site id, but the behavior can be observed across all objects (eg site_list filtered by region_id)
Add VLANs to netbox and perform a GraphQL query similar to below (where 1234567890 is not a valid site)

{
  vlan_list(filters: {site_id: "1234567890"}){
    id
    vid
    site {
      id
    }
    tenant {
      id
    }
  }
}

Expected Behavior

Return an empty list or error, as the filter is not satisfied

Observed Behavior

Returns all objects

Metadata

Metadata

Assignees

Labels

severity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtopic: GraphQLtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions