

=====================================================================

                                 CERT-Renater

                      Note d'Information No. 2022/VULN398

_____________________________________________________________________

DATE                : 25/10/2022

HARDWARE PLATFORM(S): /

OPERATING SYSTEM(S): Systems running getkirby/cms (Composer) versions
                          prior to 3.5.8.2, 3.6.6.2, 3.7.5.1, 3.8.1.

=====================================================================
https://github.com/getkirby/kirby/security/advisories/GHSA-43qq-qw4x-28f8
https://github.com/getkirby/kirby/security/advisories/GHSA-c27j-76xg-6x4f
_____________________________________________________________________

User enumeration in the code-based login and password reset forms
Moderate	bastianallgeier published GHSA-43qq-qw4x-28f8
Package
  getkirby/cms (Composer)


Affected versions
3.5.0-3.5.8.1, 3.6.0-3.6.6.1, 3.7.0-3.7.5, 3.8.0

Patched versions
3.5.8.2, 3.6.6.2, 3.7.5.1, 3.8.1


Description
TL;DR
This vulnerability only affects you if you are using the code or
password-reset auth method with the auth.methods option. It can
only be successfully exploited under server configuration
conditions outside of the attacker's control.


Introduction
User enumeration is a type of vulnerability that allows attackers to
confirm which users are registered in a Kirby installation. This
information can be abused for social engineering attacks against users
of the site or to find out the organizational structure of the company.

User enumeration attacks are performed by entering an existing and a
non-existing user into the email address field of the login form. If
the system returns a different response or behaves differently
depending on whether the user exists, the attacker can enter unknown
email addresses and use the different behavior as a clue for the
(non-)existing user.


Impact
Under normal circumstances, entering an invalid email address results
in a "fake" login code form that looks exactly like the one of an
existing user (unless debugging is enabled). However, the code that
handles the creation of a code challenge (for code-based login or
password reset) didn't catch errors that occurred while the challenge
request was processed:

If the challenge itself runs into an error (e.g. if the email could
not be sent), attackers could tell existing users (where the challenge
code is called) from non-existing users (where the challenge code is
not called and therefore does not output an error).

If you are using the user.login:failed hook and any exception is thrown
within the hook, attackers could see that the user does not exist.
As long as no error occurs during challenge creation and during the
processing of the user.login:failed hook, your Kirby sites are not
affected by this vulnerability.


Patches
The problems have been patched in Kirby 3.5.8.2, Kirby 3.6.6.2, Kirby
3.7.5.1 and Kirby 3.8.1. Please update to one of these or a later
version to fix the vulnerability.


All of the mentioned releases contain two patches for this vulnerability:

All errors that occur during the creation of an auth challenge
(code-based login or password reset) are swallowed by the backend and
only displayed to the user if debugging is enabled.

We added a new auth.debug option that can be enabled separately from
the debug option. If disabled, auth errors are only printed to the PHP
error log. This ensures that security-critical errors are only displayed
if they are really necessary for debugging.

Workarounds
We recommend to update to one of the patch releases. If you cannot update
immediately, you can work around the issue by setting the auth.methods
option to password, which disables the code-based login and password
reset forms.

However please note that your site will still be vulnerable against another
user enumeration issue that was also fixed in the same patch releases.

Credits
Thanks to Florian Merz (@florianmrz) of hatchery.io for responsibly
reporting the identified issue.


Severity
Moderate


4.8/ 10

CVSS base metrics

Attack vector
Network

Attack complexity
High

Privileges required
None

User interaction
None

Scope
Unchanged

Confidentiality
Low

Integrity
Low

Availability
None

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N

CVE ID
CVE-2022-39314

Weaknesses
CWE-204

Credits
@florianmrz florianmrz

_____________________________________________________________________

User enumeration in the brute force protection
Moderate	bastianallgeier published GHSA-c27j-76xg-6x4f

Package
  getkirby/cms (Composer)

Affected versions
<=3.5.8.1, 3.6.0-3.6.6.1, 3.7.0-3.7.5, 3.8.0

Patched versions
3.5.8.2, 3.6.6.2, 3.7.5.1, 3.8.1


Description
TL;DR
This vulnerability affects all Kirby sites with user accounts
(unless Kirby's API and Panel are disabled in the config). It
can only be exploited for targeted attacks because the attack
does not scale to brute force.


Introduction
User enumeration is a type of vulnerability that allows
attackers to confirm which users are registered in a Kirby
installation. This information can be abused for social
engineering attacks against users of the site or to find out
the organizational structure of the company.

User enumeration attacks are performed by entering an
existing and a non-existing user into the email address
field of the login form. If the system returns a different
response or behaves differently depending on whether the
user exists, the attacker can enter unknown email addresses
and use the different behavior as a clue for the
(non-)existing user.

Impact
Kirby comes with a built-in brute force protection. By
default, it will prevent further login attempts after 10
failed logins from a single IP address or of a single
existing user. After every failed login attempt, Kirby
inserts a random delay between one millisecond and two
seconds to make automated attacks harder and to avoid
leaking whether the user exists. Unfortunately, this
random delay was not inserted after the brute force
limit was reached.

Because Kirby only tracks failed login attempts per
email address for existing users but always tracks
failed login attempts per IP address, this behavior
could be abused by attackers for user enumeration.
For this to work, an attacker would need to create
login requests beyond the trials limit (which is 10
by default) from two or more IP addresses. After the
trials limit was reached, the login form immediately
blocked further requests for existing users, but not
for invalid users.

This exploit does not scale to brute force attacks
because of the delay during the first 10 requests per
user, the faint difference between the responses for
valid and invalid users and the fact that code-based
logins would send an email for every login attempt,
which makes the attack easy to spot. The vulnerability
is therefore only relevant for targeted attacks.


Patches
The problem has been patched in Kirby 3.5.8.2, Kirby
3.6.6.2, Kirby 3.7.5.1 and Kirby 3.8.1. Please update
to one of these or a later version to fix the
vulnerability.

In all of the mentioned releases, we have rewritten
the affected code so that the delay is also inserted
after the brute force limit is reached.


Severity
Moderate

6.5/ 10

CVSS base metrics

Attack vector
Network

Attack complexity
Low

Privileges required
None

User interaction
None

Scope
Unchanged

Confidentiality
Low

Integrity
Low

Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

CVE ID
CVE-2022-39315

Weaknesses
CWE-204

=========================================================
+ CERT-RENATER        |    tel : 01-53-94-20-44         +
+ 23/25 Rue Daviel    |    fax : 01-53-94-20-41         +
+ 75013 Paris         |   email:cert@support.renater.fr +
=========================================================


