Closed aaliddell closed 5 months ago
This is explicit behavior in the code https://github.com/NLnetLabs/unbound/blob/86fe9cbce533549e4310bd3fc7c1b89df70a33d4/services/localzone.c#L1873 and the man page https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound.conf.html#unbound-conf-view-local-zone.
Ok, sorry I missed that. I would suggest it’s somewhat surprising behaviour, but can’t argue with the docs 😂
Describe the bug If you have a view with only a name but no internal zones/data, it will be silently ignored and any
access-control-view
matching that view name appears to be dropped. An empty view can be useful to match a more specific IP block that otherwise matches a different view or can come about from automated tools. This silent ignoring leads to the wrong view being matched for an IP block and therefore unexpected exposure of data within that view.To reproduce Steps to reproduce the behavior:
view-first: no
. Queries hitting this should not return the data set in step 1 aboveaccess-control-view
that selects a relevant IP range and points to the empty view created in step 2view-first: no
).local-zone
entry to the otherwise empty view (with any content, it does not need to be something you will query for, only its presence matters)Expected behavior An empty view should still match an ACL and not be silently ignored. The behaviour should match what is observed in step 6 above, where a dummy zone has been added to force the view to exist. From a quick browse of code, this could be due to:
https://github.com/NLnetLabs/unbound/blob/86fe9cbce533549e4310bd3fc7c1b89df70a33d4/services/view.c#L161
System:
unbound -V
output: