]> git.proxmox.com Git - pve-http-server.git/commit
access control: correctly match v4-mapped-v6 addresses
authorStoiko Ivanov <s.ivanov@proxmox.com>
Wed, 5 May 2021 14:36:26 +0000 (16:36 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 7 May 2021 15:47:46 +0000 (17:47 +0200)
commitc6de5b3f2d8e55e7aa582dbbf6f365202a3257d5
treefd0f0ba9a9e90356304d7e305c92361d2bd243f6
parent6d42e6379283465ba40d0806382f741abf2bf644
access control: correctly match v4-mapped-v6 addresses

With recent changes to the listening socket code in pve-manager
the proxy daemons now usually bind to '::' and ipv4 clients are
read as v4-mapped-v6 addresses [0] from ::ffff:0:0/96.

This caused the allow_from/deny_from matching to break.

This patch addresses the issue by normalizing addresses from
::ffff:0:0/96 using Net::IP::ip_get_embedded_ipv4
(which roughly splits on ':' and checks if the last part looks like an
ipv4 address).

Issue was originally reported in our community forum [1]

[0] https://en.wikipedia.org/wiki/IPv6_address
[1] https://forum.proxmox.com/threads/my-pveproxy-file-doesnt-work.83228/

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
PVE/APIServer/AnyEvent.pm
PVE/APIServer/Utils.pm