netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
16.33k stars 2.6k forks source link

vlan group with large ID makes UI crash #18037

Closed jonkerj closed 1 day ago

jonkerj commented 4 days ago

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.1.6

Python Version

3.12

Steps to Reproduce

  1. deploy netbox (fresh install)
  2. create vlan group with [2, 409411115) as bounds, save
  3. visit /ipam/vlan-groups/

Notes:

Expected Behavior

Get an overview with that vlangroup

Observed Behavior

jonkerj commented 4 days ago

My (uneducated) guess is the UI request causes something to enumerate all possible VLANs in memory, in an attempt to check if they exist at all.

Shortest workaround would be to implement a validator that does not allow >=4096 VIDs. This would rule out the usage of VLAN groups for more general (ie, VNI) usage. We will implement a custom validator in the meanwhile to prevent our users from entering these.