It was found that denyhosts, a tool preventing SSH brute-force attacks, could be used to perform remote denial of service against the SSH daemon. Incorrectly specified regular expressions used to detect brute force attacks in authentication logs could be exploited by a malicious user to forge crafted login names in order to make denyhosts ban arbitrary IP addresses. A solution is proposed by the reporter, which is to tighten up the regular expressions for matching log file entries. Specifically including the $ pattern to match the end of log lines. References: http://seclists.org/oss-sec/2013/q4/535 http://www.debian.org/security/2013/dsa-2826
Created denyhosts tracking bugs for this issue: Affects: fedora-all [bug 1045983] Affects: epel-all [bug 1045984]
Created attachment 840691 [details] Patch for this vulnerability. This patch was attached by the reporter on the oss-sec post.
denyhosts-2.6-19.el6.1 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.
denyhosts-2.6-5.el5.1 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report.
denyhosts-2.6-28.fc19.1 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.
denyhosts-2.6-29.fc20.1 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.
I recently found that denyhosts was not detecting *any* attacks on root. This change in regex.py seems to guarantee that the regex will never be matched since those lines end with a port number and the word "ssh2" in my /var/log/secure file: 12c12 < FAILED_ENTRY_REGEX = re.compile(r"""Failed (?P<method>.*) for (?P<invalid>inva lid user |illegal user )?(?P<user>.*?) .*from (::ffff:)?(?P<host>\d{1,3}\.\d{1,3 }\.\d{1,3}\.\d{1,3})""") --- > FAILED_ENTRY_REGEX = re.compile(r"""Failed (?P<method>\S*) for (?P<invalid>inv alid user |illegal user )?(?P<user>.*) from (::ffff:)?(?P<host>\d{1,3}\.\d{1,3}\ .\d{1,3}\.\d{1,3})$""") Sorry if I'm not following protocol or soemthing; I'm a rather infrequent user of this site. Rodney