Bug 232931 - Autogenerated ip6tables ruleset is insecure, allowing incoming TCP connections to higher ports
Summary: Autogenerated ip6tables ruleset is insecure, allowing incoming TCP connection...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: system-config-securitylevel
Version: 5.0
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
: ---
Assignee: Thomas Woerner
QA Contact:
URL:
Whiteboard:
: 243741 (view as bug list)
Depends On: 243739
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-03-19 15:19 UTC by Peter Bieringer
Modified: 2008-05-21 16:04 UTC (History)
1 user (show)

Fixed In Version: RHBA-2008-0340
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-21 16:04:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0340 0 normal SHIPPED_LIVE system-config-securitylevel bug fix and enhancement update 2008-05-20 12:46:10 UTC

Description Peter Bieringer 2007-03-19 15:19:06 UTC
Description of problem:
After default installation of RHEL5 I found, that the generated ruleset is
insecure, it allows TCP connections to higher ports (32768-61000), which was
unexpected and sure unwanted.

In addition, it uses the wrong ICMPv6 type for rejects.

Version-Release number of selected component (if applicable):
iptables-ipv6-1.3.5-1.2.1

How reproducible:
After each installation

Steps to Reproduce:
1. install default RHEL5
2. IPv6 telnet from outside to e.g. port 36000

Actual results:

Chain RH-Firewall-1-INPUT (2 references)
 pkts bytes target     prot opt in     out     source               destination
        
    0     0 ACCEPT     all      lo     *       ::/0                 ::/0       
       
   50  4776 ACCEPT     icmpv6    *      *       ::/0                 ::/0      
        
    0     0 ACCEPT     esp      *      *       ::/0                 ::/0       
       
    0     0 ACCEPT     ah       *      *       ::/0                 ::/0       
       
    0     0 ACCEPT     udp      *      *       ::/0                 ff02::fb/128
      udp dpt:5353 
    0     0 ACCEPT     udp      *      *       ::/0                 ::/0       
       udp dpt:631 
    0     0 ACCEPT     tcp      *      *       ::/0                 ::/0       
       tcp dpt:631 
    0     0 ACCEPT     udp      *      *       ::/0                 ::/0       
       udp dpts:32768:61000 
    1    80 ACCEPT     tcp      *      *       ::/0                 ::/0       
       tcp dpts:32768:61000 !!!!
    0     0 ACCEPT     tcp      *      *       ::/0                 ::/0       
       tcp dpt:22 
    0     0 REJECT     all      *      *       ::/0                 ::/0       
       reject-with icmp6-port-unreachabl


Expected results:
Matching the REJECT ruleset.

Additional info:

Following changes in the ruleset fixes that problem and the wrong ICMP error
message.

# diff -u ip6tables.orig ip6tables
--- ip6tables.orig      2007-03-19 16:08:03.000000000 +0100
+++ ip6tables   2007-03-19 16:12:35.000000000 +0100
@@ -15,7 +15,7 @@
 -A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
 -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
 -A RH-Firewall-1-INPUT -p udp -m udp --dport 32768:61000 -j ACCEPT
--A RH-Firewall-1-INPUT -p tcp -m tcp --dport 32768:61000 -j ACCEPT
+-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 32768:61000 ! --syn -j ACCEPT
 -A RH-Firewall-1-INPUT -m tcp -p tcp --dport 22 -j ACCEPT
--A RH-Firewall-1-INPUT -j REJECT --reject-with icmp6-port-unreachable
+-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp6-adm-prohibited
 COMMIT

See also a comment on:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214117#c6

Comment 1 Thomas Woerner 2007-10-02 10:19:46 UTC
Assigning to system-config-securitylevel as this is generating the configuration.

Comment 2 Thomas Woerner 2007-10-24 11:44:35 UTC
*** Bug 243741 has been marked as a duplicate of this bug. ***

Comment 4 RHEL Program Management 2007-10-31 18:25:40 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 9 Peter Bieringer 2008-02-22 19:34:01 UTC
Dependency 243739 (closed with WONTFIX) and 243741 (closed with DUPLICATE) are
not covering the above mentioned issue. This bug is regarding the missing !
--syn for incoming TCP packets and the wrong ICMP type for admin-prohibited and
has nothing to do with the on RHEL5 not supported IPv6 connection tracking.

So at least the dependency should be removed.

Comment 12 errata-xmlrpc 2008-05-21 16:04:53 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0340.html



Note You need to log in before you can comment on or make changes to this bug.