You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the view portadmin-ip is visited using an invalid IP address as input, the page crashes with a TypeError, rather than handle the error gracefully. This also results in an e-mail being sent unnecessarily to the site admins.
It's not clear how this URL is reachable from within NAV. It may be that someone edited a URL by hand and made a typo, provoking this silly error.
To Reproduce
Go to /ipdevinfo/ip=127.0.0.256/ on your NAV installation.
See error
Expected behavior
If the IP input is invalid, the page should render normally, but display a helpful error message to that effect.
Tracebacks
Traceback (most recent call last):
File "/opt/venvs/nav/lib/python3.7/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/opt/venvs/nav/lib/python3.7/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/venvs/nav/lib/python3.7/site-packages/nav/web/ipdevinfo/views.py", line 271, in ipdev_details
netbox = get_netbox(name=name, addr=addr)
File "/opt/venvs/nav/lib/python3.7/site-packages/nav/web/ipdevinfo/views.py", line 177, in get_netbox
host_information = get_host_info(name or addr)
File "/opt/venvs/nav/lib/python3.7/site-packages/nav/web/ipdevinfo/host_information.py", line 51, in _get_host_infoif is_valid_ip(host, strict=True):
File "/opt/venvs/nav/lib/python3.7/site-packages/nav/util.py", line 80, in is_valid_ipreturn _is_valid_ip_socket(ip)
File "/opt/venvs/nav/lib/python3.7/site-packages/nav/util.py", line 88, in _is_valid_ip_socket
socket.inet_pton(socket.AF_INET, ip) # IPv4
Environment (please complete the following information):
NAV version installed: 5.6.0
The text was updated successfully, but these errors were encountered:
Describe the bug
If the view
portadmin-ip
is visited using an invalid IP address as input, the page crashes with aTypeError
, rather than handle the error gracefully. This also results in an e-mail being sent unnecessarily to the site admins.It's not clear how this URL is reachable from within NAV. It may be that someone edited a URL by hand and made a typo, provoking this silly error.
To Reproduce
/ipdevinfo/ip=127.0.0.256/
on your NAV installation.Expected behavior
If the IP input is invalid, the page should render normally, but display a helpful error message to that effect.
Tracebacks
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: