CVE-2022-39315: Getkirby/cms Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-c27j-76xg-6x4f
CVSS 6.5
CWE-668 CWE-204 CWE-209
Published
Advisory Summary

CVE-2022-39315 is a MODERATE (CVSS 6.5) remote code execution vulnerability (CWE-668: Exposure of Resource to Wrong Sphere) affecting Getkirby/cms libraries in the Packagist ecosystem. The issue involves kirby cms vulnerable to user enumeration in the brute force protection. Remediation is available by upgrading affected packages to version 3.5.8.2, 3.6.6.2, 3.7.5.1, 3.8.1.

CVE-2022-39315 at a Glance

CVE Identifier CVE-2022-39315
GHSA Identifier GHSA-c27j-76xg-6x4f
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-668: Exposure of Resource to Wrong Sphere
Affected Product Getkirby/cms
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2022-39315

To remediate this vulnerability, upgrade all affected Getkirby/cms dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

getkirby/cms fixed: 3.5.8.2
Upgrade getkirby/cms to 3.5.8.2
getkirby/cms fixed: 3.6.6.2
Upgrade getkirby/cms to 3.6.6.2
getkirby/cms fixed: 3.7.5.1
Upgrade getkirby/cms to 3.7.5.1
getkirby/cms fixed: 3.8.1
Upgrade getkirby/cms to 3.8.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for getkirby/cms

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-39315, inspect your project dependencies for Getkirby/cms:

inspect dependencies for getkirby/cms

Analyze the terminal output to locate any version of Getkirby/cms in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.5.8.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-668: Exposure of Resource to Wrong Sphere, where the product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. In Getkirby/cms, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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](https://github.com/getkirby/kirby/releases/tag/3.5.8.2), [Kirby 3.6.6.2](https://github.com/getkirby/kirby/releases/tag/3.6.6.2), [Kirby 3.7.5.1](https://github.com/getkirby/kirby/releases/tag/3.7.5.1) and [Kirby 3.8.1](https://github.com/getkirby/kirby/releases/tag/3.8.1). Please update to one of these or a [later version](https://github.com/getkirby/kirby/releases) 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.

CVE-2022-39315 Affected Getkirby/cms Versions

4 component(s)
Fixed Versions:
3.5.8.23.6.6.23.7.5.13.8.1
Product / Package Ecosystem Affected Versions Fixed Version
getkirby/cms
Packagist
< 3.5.8.2
3.5.8.2
getkirby/cms
Packagist
≥ 3.6.0
< 3.6.6.2
3.6.6.2
getkirby/cms
Packagist
≥ 3.7.0
< 3.7.5.1
3.7.5.1
getkirby/cms
Packagist
≥ 3.8.0
< 3.8.1
All 1 versions
3.8.0
3.8.1

References

Frequently Asked Questions

What is CVE-2022-39315?
CVE-2022-39315 is a security vulnerability in Getkirby/cms involving Kirby CMS vulnerable to user enumeration in the brute force protection under CWE-668: Exposure of Resource to Wrong Sphere.
Which Getkirby/cms versions are affected?
Affected versions include releases prior to 3.5.8.2, 3.6.6.2, 3.7.5.1, 3.8.1 across affected packages: getkirby/cms.
What version fixes CVE-2022-39315?
Upgrading to 3.5.8.2, 3.6.6.2, 3.7.5.1, 3.8.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is getkirby/cms affected?
Yes, getkirby/cms is affected in releases prior to 3.5.8.2, 3.6.6.2, 3.7.5.1, 3.8.1. Upgrade your dependency to 3.5.8.2, 3.6.6.2, 3.7.5.1, 3.8.1 or later.
What is the CVSS score of CVE-2022-39315?
CVE-2022-39315 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2022-39315?
CVE-2022-39315 is classified under CWE-668: Exposure of Resource to Wrong Sphere (The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.).
How can I check Packagist dependencies for CVE-2022-39315?
Run the dependency tree command: 'inspect dependencies for getkirby/cms'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c27j-76xg-6x4f",
  "modified" : "2022-10-18T21:16:27Z",
  "published" : "2022-10-18T21:16:27Z",
  "aliases" : [ "CVE-2022-39315" ],
  "summary" : "Kirby CMS vulnerable to user enumeration in the brute force protection",
  "details" : "### TL;DR\n\nThis 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.\n\n----\n\n### Introduction\n\nUser 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.\n\nUser 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.\n\n### Impact\n\nKirby 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.\n\nBecause 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.\n\nThis 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.\n\n### Patches\n\nThe problem has been patched in [Kirby 3.5.8.2](https://github.com/getkirby/kirby/releases/tag/3.5.8.2), [Kirby 3.6.6.2](https://github.com/getkirby/kirby/releases/tag/3.6.6.2), [Kirby 3.7.5.1](https://github.com/getkirby/kirby/releases/tag/3.7.5.1) and [Kirby 3.8.1](https://github.com/getkirby/kirby/releases/tag/3.8.1). Please update to one of these or a [later version](https://github.com/getkirby/kirby/releases) to fix the vulnerability.\n\nIn 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" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "getkirby/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.5.8.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "getkirby/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.6.0"
      }, {
        "fixed" : "3.6.6.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "getkirby/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.7.0"
      }, {
        "fixed" : "3.7.5.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "getkirby/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.8.0"
      }, {
        "fixed" : "3.8.1"
      } ]
    } ],
    "versions" : [ "3.8.0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/getkirby/kirby/security/advisories/GHSA-c27j-76xg-6x4f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39315"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/getkirby/kirby"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getkirby/kirby/releases/tag/3.5.8.2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getkirby/kirby/releases/tag/3.6.6.2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getkirby/kirby/releases/tag/3.7.5.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getkirby/kirby/releases/tag/3.8.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-204", "CWE-209", "CWE-668" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-10-18T21:16:27Z",
    "nvd_published_at" : "2022-10-25T17:15:00Z"
  }
}