Bug 1045982 (CVE-2013-6890)

Summary: CVE-2013-6890 denyhosts: remote denial of ssh service
Product: [Other] Security Response Reporter: Ratul Gupta <ratulg>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: bugzilla, dennis, j
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-22 06:01:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1045983, 1045984    
Bug Blocks:    
Attachments:
Description Flags
Patch for this vulnerability. none

Description Ratul Gupta 2013-12-23 06:39:01 UTC
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

Comment 1 Ratul Gupta 2013-12-23 06:40:17 UTC
Created denyhosts tracking bugs for this issue:

Affects: fedora-all [bug 1045983]
Affects: epel-all [bug 1045984]

Comment 2 Ratul Gupta 2013-12-23 06:42:16 UTC
Created attachment 840691 [details]
Patch for this vulnerability.

This patch was attached by the reporter on the oss-sec post.

Comment 4 Fedora Update System 2015-01-04 20:06:24 UTC
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.

Comment 5 Fedora Update System 2015-01-04 20:08:17 UTC
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.

Comment 6 Fedora Update System 2015-01-05 07:38:11 UTC
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.

Comment 7 Fedora Update System 2015-01-05 07:38:50 UTC
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.

Comment 8 Rodney 2015-01-14 18:41:01 UTC
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