Hello,
cntlm's acl_check() does not apply Allow/Deny rules to IPv6 clients.
Confirmed on master 793df79 (reports 0.94.1) and present in Debian
0.94.0+dfsg-2.
Where: acl_check(), acl.c:118 (master) / acl.c:123+136 (Debian)
Type: CWE-284 improper access control (fail-open)
CVSS: AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N [proposed, indicative]
acl_check() iterates the rules only when caddr->sa_family == AF_INET; for
AF_INET6 it falls through to `return ACL_ALLOW`, so Deny rules never
apply to
IPv6 clients.
Reproduction (container, loopback): Deny 0.0.0.0/0, Gateway yes, Listen
on both
127.0.0.1:3128 and [::1]:3128.
- IPv4 via 127.0.0.1 -> blocked ("HTTP/1.0 407 Access denied"; log
"Connection denied for 127.0.0.1").
- IPv6 via ::1 -> served (passes acl_check, reaches upstream attempt
502; no
deny logged).
Fix: evaluate rules for AF_INET6 (IPv6 rules; IPv4-mapped ::ffff:a.b.c.d
against IPv4 rules). When rules exist but the family is unhandled, fail
closed.
Thanks in advance,
Ing. Maximiliano Sebastián Quiroga
--
km-it GmbH | Luxemburger Straße 152 | 50937 Köln
0221/66990450 14 | [email protected]
HRB 45350 | Amtsgericht Köln | UStIdNr. DE224066099