• Florian Westphal's avatar
    netfilter: conntrack: don't set related state for different outer address · 1025ce75
    Florian Westphal authored
    Luca Moro says:
     ------
    The issue lies in the filtering of ICMP and ICMPv6 errors that include an
    inner IP datagram.
    For these packets, icmp_error_message() extract the ICMP error and inner
    layer to search of a known state.
    If a state is found the packet is tagged as related (IP_CT_RELATED).
    
    The problem is that there is no correlation check between the inner and
    outer layer of the packet.
    So one can encapsulate an error with an inner layer matching a known state,
    while its outer layer is directed to a filtered host.
    In this case the whole packet will be tagged as related.
    This has various implications from a rule bypass (if a rule to related
    trafic is allow), to a known state oracle.
    
    Unfortunately, we could not find a real statement in a RFC on how this case
    should be filtered.
    The closest we found is RFC5927 (Section 4.3) but it is not very clear.
    
    A possible fix would be to check that the inner IP source is the same than
    the out...
    1025ce75
nf_conntrack_proto_icmp.c 10.8 KB