Lack of Rule-Type Check in sortAndFilter() Leads to IP Allow-List Bypass via Silently Erased REJECT Rules
Description
IpSubnetFilter in io.netty:netty-handler is Netty's CIDR-based IP access control handler. Operators configure it with a list of IpSubnetFilterRule entries of type ACCEPT or REJECT, and the handler admits or drops connections accordingly. The standard "allow 10/8 except 10.5/16" pattern — allowing a broad corporate CIDR but denying a quarantine VLAN — is the canonical use case.
IpSubnetFilter.sortAndFilter() de-duplicates the operator-supplied rule list by dropping any rule whose network address falls inside the previous rule's subnet — without checking ruleType().
Beside this AbstractRemoteAddressFilter.handleNewChannel() removes itself from the pipeline before calling accept(). If accept() throws, the exception propagates to `DefaultChannelPipeline.onUnhandledInboundException which logs WARN and returns — the channel is never closed.