Bug 32995 - Missing gateway validation
Missing gateway validation
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: UMC - Basic settings
UCS 4.1
All Linux
: P2 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-28 22:14 CET by Philipp Hahn
Modified: 2019-01-03 07:18 CET (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.103
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): IPv6, Troubleshooting, Usability
Max CVSS v3 score:
hahn: Patch_Available+


Attachments
Validate gateway addresses (7.57 KB, patch)
2013-10-28 22:14 CET, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2013-10-28 22:14:20 CET
Created attachment 5537 [details]
Validate gateway addresses

The IP address of the default gateway is not validated: The IP address given must be located in one of the network ranges of the configured interfaces.

Currently ifup ignores the invalid address, but the host becomes unreachable, since it now longer can't communicate with hosts outside its local sub-networks.
Comment 1 Florian Best univentionstaff 2013-10-29 08:07:36 CET
hmm, don't remove the IP4Set() and IP6Set(). Otherwise same IP addresses aren't equal. '::1' != '0::1' / '127.0.0.1' != '127.00.0.1'.
Comment 2 Florian Best univentionstaff 2013-10-29 08:11:39 CET
ah nvm, I didn't watch the patch exactly.
Comment 3 Philipp Hahn univentionstaff 2013-10-31 11:43:10 CET
This is really annoying, especially during testing for Bug #28670, as the VM looses its network connection.

The patch has one minor cosmetic bug: If the address is not (syntax-)valid, two errors are displayed. Bug #32815 would fix that.
Comment 4 Florian Best univentionstaff 2014-07-25 10:54:01 CEST
IMHO important as the new wizard writes wrong default gateway values!
Comment 5 Alexander Kläser univentionstaff 2014-07-25 13:00:50 CEST
(In reply to Florian Best from comment #4)
> IMHO important as the new wizard writes wrong default gateway values!

Currently, there are checks for correct ipv4/ipv6 addresses in the frontend + backend code.
Comment 6 Philipp Hahn univentionstaff 2014-07-25 13:14:39 CEST
(In reply to Alexander Kläser from comment #5)
> (In reply to Florian Best from comment #4)
> > IMHO important as the new wizard writes wrong default gateway values!
> 
> Currently, there are checks for correct ipv4/ipv6 addresses in the frontend
> + backend code.

They only check the syntax, but not the semantic:

The gateway 10.0.0.1 is not in the network 192.168.0.0/24, so the IP stack can't reach the gateway and thus no host outside the given network is reachable.

from ipaddr import IPAddress, IPNetwork
assert(IPAddress(gateway) in IPNetwork(network))
Comment 7 Philipp Hahn univentionstaff 2014-11-12 10:14:12 CET
For IPv6 see Bug #23897 where link-local fe80::/10 are also valid while not being configured explicitly via UCR.
Comment 8 Moritz Bunkus 2016-10-20 14:49:00 CEST
Today a user on the forum[1] asked about how to configure a gateway that's not part of the subnet configured for the address. He's trying to install UCS on a root server, and the scenario that the gateway is outside of the network interface's subnet is rather common due to IPv4 shortage.

Yes, this works just fine if a host route is established for the gateway. And yes, base Debian[2] does support such a scenario with the "pointopoint …" key word in "/etc/network/interfaces". It even seems that UCS supports such a scenario: the template "/etc/univention/templates/files/etc/network/interfaces.d/10-default" checks if the subnet mask has all bits set and inserts the appropriate "pointopoint" entry for the geteway if that's the case.

Additionally an IPv6 gateway can often be a link-local address (fe80::/10) as Philipp has said. In that case the gateway isn't part of the subnet either.

So please do NOT restrict the gateway. Instead fix the installer to recognize the need for an additional host route to the gateway.

[1] http://forum.univention.de/posting.php?mode=reply&f=48&t=6147#pr22780
[2] https://wiki.hetzner.de/index.php/Netzkonfiguration_Debian
Comment 9 Stefan Gohmann univentionstaff 2019-01-03 07:18:38 CET
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018.

Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.