<?xml version="1.0" encoding="UTF-8"?>
<cvrfdoc xmlns="http://www.icasi.org/CVRF/schema/cvrf/1.1" xmlns:cvrf="http://www.icasi.org/CVRF/schema/cvrf/1.1">
  <DocumentTitle xml:lang="en">Security update for fail2ban</DocumentTitle>
  <DocumentType>SUSE Patch</DocumentType>
  <DocumentPublisher Type="Vendor">
    <ContactDetails>security@suse.de</ContactDetails>
    <IssuingAuthority>SUSE Security Team</IssuingAuthority>
  </DocumentPublisher>
  <DocumentTracking>
    <Identification>
      <ID>openSUSE-SU-2021:1274-1</ID>
    </Identification>
    <Status>Final</Status>
    <Version>1</Version>
    <RevisionHistory>
      <Revision>
        <Number>1</Number>
        <Date>2021-09-16T08:04:03Z</Date>
        <Description>current</Description>
      </Revision>
    </RevisionHistory>
    <InitialReleaseDate>2021-09-16T08:04:03Z</InitialReleaseDate>
    <CurrentReleaseDate>2021-09-16T08:04:03Z</CurrentReleaseDate>
    <Generator>
      <Engine>cve-database/bin/generate-cvrf.pl</Engine>
      <Date>2017-02-24T01:00:00Z</Date>
    </Generator>
  </DocumentTracking>
  <DocumentNotes>
    <Note Title="Topic" Type="Summary" Ordinal="1" xml:lang="en">Security update for fail2ban</Note>
    <Note Title="Details" Type="General" Ordinal="2" xml:lang="en">This update for fail2ban fixes the following issues:

- CVE-2021-32749: prevent a command injection via mail command (boo#1188610)

- Integrate change to resolve boo#1146856 and boo#1180738

Update to 0.11.2

- increased stability, filter and action updates
  
New Features and Enhancements

* fail2ban-regex:
  - speedup formatted output (bypass unneeded stats creation)
  - extended with prefregex statistic
  - more informative output for `datepattern` (e. g. set from filter) - pattern : description
* parsing of action in jail-configs considers space between action-names as separator also
  (previously only new-line was allowed), for example `action = a b` would specify 2 actions `a` and `b`
* new filter and jail for GitLab recognizing failed application logins (gh#fail2ban/fail2ban#2689)
* new filter and jail for Grafana recognizing failed application logins (gh#fail2ban/fail2ban#2855)
* new filter and jail for SoftEtherVPN recognizing failed application logins (gh#fail2ban/fail2ban#2723)
* `filter.d/guacamole.conf` extended with `logging` parameter to follow webapp-logging if it's configured 
  (gh#fail2ban/fail2ban#2631)
* `filter.d/bitwarden.conf` enhanced to support syslog (gh#fail2ban/fail2ban#2778)
* introduced new prefix `{UNB}` for `datepattern` to disable word boundaries in regex;
* datetemplate: improved anchor detection for capturing groups `(^...)`;
* datepattern: improved handling with wrong recognized timestamps (timezones, no datepattern, etc)
  as well as some warnings signaling user about invalid pattern or zone (gh#fail2ban/fail2ban#2814):
  - filter gets mode in-operation, which gets activated if filter starts processing of new messages;
    in this mode a timestamp read from log-line that appeared recently (not an old line), deviating too much
    from now (up too 24h), will be considered as now (assuming a timezone issue), so could avoid unexpected 
    bypass of failure (previously exceeding `findtime`);
  - better interaction with non-matching optional datepattern or invalid timestamps;
  - implements special datepattern `{NONE}` - allow to find failures totally without date-time in log messages,
  whereas filter will use now as timestamp (gh#fail2ban/fail2ban#2802)
* performance optimization of `datepattern` (better search algorithm in datedetector, especially for single template);
* fail2ban-client: extended to unban IP range(s) by subnet (CIDR/mask) or hostname (DNS), gh#fail2ban/fail2ban#2791;
* extended capturing of alternate tags in filter, allowing combine of multiple groups to single tuple token with new tag
  prefix `&lt;F-TUPLE_`, that would combine value of `&lt;F-V&gt;` with all value of `&lt;F-TUPLE_V?_n?&gt;` tags (gh#fail2ban/fail2ban#2755)
- Fixes
* [stability] prevent race condition - no ban if filter (backend) is continuously busy if
  too many messages will be found in log, e. g. initial scan of large log-file or journal (gh#fail2ban/fail2ban#2660)
* pyinotify-backend sporadically avoided initial scanning of log-file by start
* python 3.9 compatibility (and Travis CI support)
* restoring a large number (500+ depending on files ulimit) of current bans when using PyPy fixed
* manual ban is written to database, so can be restored by restart (gh#fail2ban/fail2ban#2647)
* `jail.conf`: don't specify `action` directly in jails (use `action_` or `banaction` instead)
* no mails-action added per default anymore (e. g. to allow that `action = %(action_mw)s` should be specified
  per jail or in default section in jail.local), closes gh#fail2ban/fail2ban#2357
* ensure we've unique action name per jail (also if parameter `actname` is not set but name deviates from standard name, gh#fail2ban/fail2ban#2686)
* don't use `%(banaction)s` interpolation because it can be complex value (containing `[...]` and/or quotes), 
  so would bother the action interpolation
* fixed type conversion in config readers (take place after all interpolations get ready), that allows to 
  specify typed parameters variable (as substitutions) as well as to supply it in other sections or as init parameters.
* `action.d/*-ipset*.conf`: several ipset actions fixed (no timeout per default anymore), so no discrepancy
  between ipset and fail2ban (removal from ipset will be managed by fail2ban only, gh#fail2ban/fail2ban#2703)
* `action.d/cloudflare.conf`: fixed `actionunban` (considering new-line chars and optionally real json-parsing
 with `jq`, gh#fail2ban/fail2ban#2140, gh#fail2ban/fail2ban#2656)
* `action.d/nftables.conf` (type=multiport only): fixed port range selector, replacing `:` with `-` (gh#fail2ban/fail2ban#2763)
* `action.d/firewallcmd-*.conf` (multiport only): fixed port range selector, replacing `:` with `-` (gh#fail2ban/fail2ban#2821)
* `action.d/bsd-ipfw.conf`: fixed selection of rule-no by large list or initial `lowest_rule_num` (gh#fail2ban/fail2ban#2836)
* `filter.d/common.conf`: avoid substitute of default values in related `lt_*` section, `__prefix_line`
  should be interpolated in definition section (inside the filter-config, gh#fail2ban/fail2ban#2650)
* `filter.d/dovecot.conf`: 
  - add managesieve and submission support (gh#fail2ban/fail2ban#2795);
  - accept messages with more verbose logging (gh#fail2ban/fail2ban#2573);
* `filter.d/courier-smtp.conf`: prefregex extended to consider port in log-message (gh#fail2ban/fail2ban#2697)
* `filter.d/traefik-auth.conf`: filter extended with parameter mode (`normal`, `ddos`, `aggressive`) to handle 
  the match of username differently (gh#fail2ban/fail2ban#2693):
  - `normal`: matches 401 with supplied username only
  - `ddos`: matches 401 without supplied username only
  - `aggressive`: matches 401 and any variant (with and without username)
* `filter.d/sshd.conf`: normalizing of user pattern in all RE's, allowing empty user (gh#fail2ban/fail2ban#2749)

Update to 0.11.1:

* Increment ban time (+ observer) functionality introduced.
* Database functionality extended with bad ips.
* New tags (usable in actions):
  - `&lt;bancount&gt;` - ban count of this offender if known as bad
    (started by 1 for unknown)
  - `&lt;bantime&gt;` - current ban-time of the ticket
    (prolongation can be retarded up to 10 sec.)
* Introduced new action command `actionprolong` to prolong ban-time
  (e. g. set new timeout if expected);
* algorithm of restore current bans after restart changed:
  update the restored ban-time (and therefore 
  end of ban) of the ticket with ban-time of jail (as maximum),
  for all tickets with ban-time greater (or persistent)
* added new setup-option `--without-tests` to skip building
  and installing of tests files (gh-2287).
* added new command `fail2ban-client get &lt;JAIL&gt; banip ?sep-char|--with-time?`
  to get the banned ip addresses (gh-1916).
* purge database will be executed now (within observer).
 restoring currently banned ip after service restart fixed
  (now &lt; timeofban + bantime), ignore old log failures (already banned)
* upgrade database: update new created table `bips` with entries
  from table `bans` (allows restore current bans after
  upgrade from version &lt;= 0.10)

- removal of SuSEfirewall2-fail2ban for factory versions since SuSEfirewall2
  will be removed from Factory (see sr#713247):
* removed references to SuSEfirewall2 service
* use references to SuSEfirewall2 only for older distributions
* Removed installation recommendation of the fail2ban-SuSEfirewall2
  package for all distributions as it is deprecated.
- changed fail2ban unit file location (boo#1145181, gh#fail2ban/fail2ban#2474)
</Note>
    <Note Title="Terms of Use" Type="Legal Disclaimer" Ordinal="3" xml:lang="en">The CVRF data is provided by SUSE under the Creative Commons License 4.0 with Attribution (CC-BY-4.0).</Note>
    <Note Title="Patchnames" Type="Details" Ordinal="4" xml:lang="en">openSUSE-2021-1274</Note>
  </DocumentNotes>
  <DocumentDistribution xml:lang="en">Copyright SUSE LLC under the Creative Commons License 4.0 with Attribution (CC-BY-4.0)</DocumentDistribution>
  <DocumentReferences>
    <Reference Type="Self">
      <URL>https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/RYBYCPVAMLJBPZO42ZMSVOQTCNN3YNQS/</URL>
      <Description>E-Mail link for openSUSE-SU-2021:1274-1</Description>
    </Reference>
    <Reference Type="Self">
      <URL>https://www.suse.com/support/security/rating/</URL>
      <Description>SUSE Security Ratings</Description>
    </Reference>
    <Reference Type="Self">
      <URL>https://bugzilla.suse.com/1145181</URL>
      <Description>SUSE Bug 1145181</Description>
    </Reference>
    <Reference Type="Self">
      <URL>https://bugzilla.suse.com/1146856</URL>
      <Description>SUSE Bug 1146856</Description>
    </Reference>
    <Reference Type="Self">
      <URL>https://bugzilla.suse.com/1180738</URL>
      <Description>SUSE Bug 1180738</Description>
    </Reference>
    <Reference Type="Self">
      <URL>https://bugzilla.suse.com/1188610</URL>
      <Description>SUSE Bug 1188610</Description>
    </Reference>
    <Reference Type="Self">
      <URL>https://www.suse.com/security/cve/CVE-2021-32749/</URL>
      <Description>SUSE CVE CVE-2021-32749 page</Description>
    </Reference>
  </DocumentReferences>
  <ProductTree xmlns="http://www.icasi.org/CVRF/schema/prod/1.1">
    <Branch Type="Product Family" Name="SUSE Package Hub 15 SP1">
      <Branch Type="Product Name" Name="SUSE Package Hub 15 SP1">
        <FullProductName ProductID="SUSE Package Hub 15 SP1">SUSE Package Hub 15 SP1</FullProductName>
      </Branch>
    </Branch>
    <Branch Type="Product Family" Name="SUSE Package Hub 15 SP2">
      <Branch Type="Product Name" Name="SUSE Package Hub 15 SP2">
        <FullProductName ProductID="SUSE Package Hub 15 SP2">SUSE Package Hub 15 SP2</FullProductName>
      </Branch>
    </Branch>
    <Branch Type="Product Family" Name="SUSE Package Hub 15 SP3">
      <Branch Type="Product Name" Name="SUSE Package Hub 15 SP3">
        <FullProductName ProductID="SUSE Package Hub 15 SP3">SUSE Package Hub 15 SP3</FullProductName>
      </Branch>
    </Branch>
    <Branch Type="Product Family" Name="openSUSE Leap 15.2">
      <Branch Type="Product Name" Name="openSUSE Leap 15.2">
        <FullProductName ProductID="openSUSE Leap 15.2" CPE="cpe:/o:opensuse:leap:15.2">openSUSE Leap 15.2</FullProductName>
      </Branch>
    </Branch>
    <Branch Type="Product Family" Name="openSUSE Leap 15.3">
      <Branch Type="Product Name" Name="openSUSE Leap 15.3">
        <FullProductName ProductID="openSUSE Leap 15.3" CPE="cpe:/o:opensuse:leap:15.3">openSUSE Leap 15.3</FullProductName>
      </Branch>
    </Branch>
    <Branch Type="Product Version" Name="fail2ban-0.11.2-bp153.2.3.1">
      <FullProductName ProductID="fail2ban-0.11.2-bp153.2.3.1">fail2ban-0.11.2-bp153.2.3.1</FullProductName>
    </Branch>
    <Branch Type="Product Version" Name="monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1">
      <FullProductName ProductID="monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1">monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1</FullProductName>
    </Branch>
    <Relationship ProductReference="fail2ban-0.11.2-bp153.2.3.1" RelationType="Default Component Of" RelatesToProductReference="SUSE Package Hub 15 SP1">
      <FullProductName ProductID="SUSE Package Hub 15 SP1:fail2ban-0.11.2-bp153.2.3.1">fail2ban-0.11.2-bp153.2.3.1 as a component of SUSE Package Hub 15 SP1</FullProductName>
    </Relationship>
    <Relationship ProductReference="monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1" RelationType="Default Component Of" RelatesToProductReference="SUSE Package Hub 15 SP1">
      <FullProductName ProductID="SUSE Package Hub 15 SP1:monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1">monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1 as a component of SUSE Package Hub 15 SP1</FullProductName>
    </Relationship>
    <Relationship ProductReference="fail2ban-0.11.2-bp153.2.3.1" RelationType="Default Component Of" RelatesToProductReference="SUSE Package Hub 15 SP2">
      <FullProductName ProductID="SUSE Package Hub 15 SP2:fail2ban-0.11.2-bp153.2.3.1">fail2ban-0.11.2-bp153.2.3.1 as a component of SUSE Package Hub 15 SP2</FullProductName>
    </Relationship>
    <Relationship ProductReference="monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1" RelationType="Default Component Of" RelatesToProductReference="SUSE Package Hub 15 SP2">
      <FullProductName ProductID="SUSE Package Hub 15 SP2:monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1">monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1 as a component of SUSE Package Hub 15 SP2</FullProductName>
    </Relationship>
    <Relationship ProductReference="fail2ban-0.11.2-bp153.2.3.1" RelationType="Default Component Of" RelatesToProductReference="SUSE Package Hub 15 SP3">
      <FullProductName ProductID="SUSE Package Hub 15 SP3:fail2ban-0.11.2-bp153.2.3.1">fail2ban-0.11.2-bp153.2.3.1 as a component of SUSE Package Hub 15 SP3</FullProductName>
    </Relationship>
    <Relationship ProductReference="monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1" RelationType="Default Component Of" RelatesToProductReference="SUSE Package Hub 15 SP3">
      <FullProductName ProductID="SUSE Package Hub 15 SP3:monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1">monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1 as a component of SUSE Package Hub 15 SP3</FullProductName>
    </Relationship>
    <Relationship ProductReference="fail2ban-0.11.2-bp153.2.3.1" RelationType="Default Component Of" RelatesToProductReference="openSUSE Leap 15.2">
      <FullProductName ProductID="openSUSE Leap 15.2:fail2ban-0.11.2-bp153.2.3.1">fail2ban-0.11.2-bp153.2.3.1 as a component of openSUSE Leap 15.2</FullProductName>
    </Relationship>
    <Relationship ProductReference="monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1" RelationType="Default Component Of" RelatesToProductReference="openSUSE Leap 15.2">
      <FullProductName ProductID="openSUSE Leap 15.2:monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1">monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1 as a component of openSUSE Leap 15.2</FullProductName>
    </Relationship>
    <Relationship ProductReference="fail2ban-0.11.2-bp153.2.3.1" RelationType="Default Component Of" RelatesToProductReference="openSUSE Leap 15.3">
      <FullProductName ProductID="openSUSE Leap 15.3:fail2ban-0.11.2-bp153.2.3.1">fail2ban-0.11.2-bp153.2.3.1 as a component of openSUSE Leap 15.3</FullProductName>
    </Relationship>
    <Relationship ProductReference="monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1" RelationType="Default Component Of" RelatesToProductReference="openSUSE Leap 15.3">
      <FullProductName ProductID="openSUSE Leap 15.3:monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1">monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1 as a component of openSUSE Leap 15.3</FullProductName>
    </Relationship>
  </ProductTree>
  <Vulnerability xmlns="http://www.icasi.org/CVRF/schema/vuln/1.1" Ordinal="1">
    <Notes>
      <Note Title="Vulnerability Description" Type="General" Ordinal="1" xml:lang="en">fail2ban is a daemon to ban hosts that cause multiple authentication errors. In versions 0.9.7 and prior, 0.10.0 through 0.10.6, and 0.11.0 through 0.11.2, there is a vulnerability that leads to possible remote code execution in the mailing action mail-whois. Command `mail` from mailutils package used in mail actions like `mail-whois` can execute command if unescaped sequences (`\n~`) are available in "foreign" input (for instance in whois output). To exploit the vulnerability, an attacker would need to insert malicious characters into the response sent by the whois server, either via a MITM attack or by taking over a whois server. The issue is patched in versions 0.10.7 and 0.11.3. As a workaround, one may avoid the usage of action `mail-whois` or patch the vulnerability manually.</Note>
    </Notes>
    <CVE>CVE-2021-32749</CVE>
    <ProductStatuses>
      <Status Type="Fixed">
        <ProductID>SUSE Package Hub 15 SP1:fail2ban-0.11.2-bp153.2.3.1</ProductID>
        <ProductID>SUSE Package Hub 15 SP1:monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1</ProductID>
        <ProductID>SUSE Package Hub 15 SP2:fail2ban-0.11.2-bp153.2.3.1</ProductID>
        <ProductID>SUSE Package Hub 15 SP2:monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1</ProductID>
        <ProductID>SUSE Package Hub 15 SP3:fail2ban-0.11.2-bp153.2.3.1</ProductID>
        <ProductID>SUSE Package Hub 15 SP3:monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1</ProductID>
        <ProductID>openSUSE Leap 15.2:fail2ban-0.11.2-bp153.2.3.1</ProductID>
        <ProductID>openSUSE Leap 15.2:monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1</ProductID>
        <ProductID>openSUSE Leap 15.3:fail2ban-0.11.2-bp153.2.3.1</ProductID>
        <ProductID>openSUSE Leap 15.3:monitoring-plugins-fail2ban-0.11.2-bp153.2.3.1</ProductID>
      </Status>
    </ProductStatuses>
    <Threats>
      <Threat Type="Impact">
        <Description>important</Description>
      </Threat>
    </Threats>
    <CVSSScoreSets>
      <ScoreSet>
        <BaseScore>6.8</BaseScore>
        <Vector>AV:N/AC:M/Au:N/C:P/I:P/A:P</Vector>
      </ScoreSet>
    </CVSSScoreSets>
    <Remediations>
      <Remediation Type="Vendor Fix">
        <Description xml:lang="en">To install this SUSE Security Update use the SUSE recommended installation methods like YaST online_update or "zypper patch".
</Description>
        <URL>https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/RYBYCPVAMLJBPZO42ZMSVOQTCNN3YNQS/</URL>
      </Remediation>
    </Remediations>
    <References>
      <Reference>
        <URL>https://www.suse.com/security/cve/CVE-2021-32749.html</URL>
        <Description>CVE-2021-32749</Description>
      </Reference>
      <Reference>
        <URL>https://bugzilla.suse.com/1188610</URL>
        <Description>SUSE Bug 1188610</Description>
      </Reference>
    </References>
  </Vulnerability>
</cvrfdoc>
