Arbitrary IP Banning via Username Injection in fail2ban SSHD Filter
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
| Vendor | Product | Default status | Versions | ||||||
|---|---|---|---|---|---|---|---|---|---|
| fail2ban | fail2ban | unknown |
|
No data.
No data.
| Vendor | Product | Versions | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Fail2ban | Fail2ban |
|
Vendor Solution
Apply upstream commit ddd879d22664904ace24e1255ac6571808c58187, or upgrade to the first fail2ban release after 1.1.1 that contains it.
Vendor Workaround
Override __on_port_opt and __suff in a local filter.d/sshd.local so that only an optional "port N" may follow the host address, as in the upstream fix: __on_port_opt = (?: port \d+)? and __suff = %(__on_port_opt)s(?: \[preauth\])?\s*. Add the administrator's own addresses to ignoreip.
No CVSS v4.0
No CVSS v3.0
No CVSS v2
This CVE is not in the KEV list.
Exploit prediction score: < 1% (0.314% probability within 30 days)
| Type | Values Removed | Values Added |
|---|---|---|
| Metrics |
ssvc
|
| Type | Values Removed | Values Added |
|---|---|---|
| Title | Arbitrary IP Banning via Username Injection in fail2ban SSHD Filter |
| Type | Values Removed | Values Added |
|---|---|---|
| Description | In fail2ban 0.10.5 through 1.1.1 before ddd879d, the sshd filter (config/filter.d/sshd.conf) accepts an "on <token>" suffix after the host address. Because OpenSSH logs the offered username verbatim, a remote unauthenticated attacker can use a username such as "x VICTIM-SOURCE-IP-ADDRESS on" to make fail2ban associate failed login attempts with an arbitrary source IP address and ban it (e.g., to block logins from a legitimate user). The default filter mode is affected. | |
| First Time appeared |
Fail2ban
Fail2ban fail2ban |
|
| Weaknesses | CWE-117 | |
| CPEs | cpe:2.3:a:fail2ban:fail2ban:*:*:*:*:*:*:*:* | |
| Vendors & Products |
Fail2ban
Fail2ban fail2ban |
|
| References |
| |
| Metrics |
cvssV3_1
|