CVE-2022-32563: Couchbase Couchbase Sync Gateway Admin Credentials Vulnerability

CRITICAL
Advisory Identifier: GHSA-9266-j9v3-q4j5
CVSS 9.8
CWE-295
Published
Advisory Summary

CVE-2022-32563 is a CRITICAL (CVSS 9.8) couchbase sync gateway admin credentials vulnerability (CWE-295: Improper Certificate Validation) affecting Couchbase libraries in the PyPI ecosystem. The issue involves couchbase sync gateway admin credentials not verified when using x.509 client cert authentication. Remediation is available by upgrading affected packages to version 3.0.2.

CVE-2022-32563 at a Glance

CVE Identifier CVE-2022-32563
GHSA Identifier GHSA-9266-j9v3-q4j5
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-295: Improper Certificate Validation
Affected Product Couchbase
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.8

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:H/I:H/A:H).

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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2022-32563

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

couchbase fixed: 3.0.2
pip install couchbase>=3.0.2
Verify Direct and Transitive Dependencies

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

pip show couchbase

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2022-32563, inspect your installed packages using pip:

pip show couchbase

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

Note: The pip show couchbase command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-295: Improper Certificate Validation, where the product does not validate, or incorrectly validates, a certificate. In Couchbase, 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

An issue was discovered in Couchbase Sync Gateway 3.x before 3.0.2. Admin credentials are not verified when using X.509 client-certificate authentication from Sync Gateway to Couchbase Server. When Sync Gateway is configured to authenticate with Couchbase Server using X.509 client certificates, the admin credentials provided to the Admin REST API are ignored, resulting in privilege escalation for unauthenticated users. The Public REST API is not impacted by this issue. A workaround is to replace X.509 certificate based authentication with Username and Password authentication inside the bootstrap configuration.

CVE-2022-32563 Affected Couchbase Versions

1 component(s)
Fixed Versions:
3.0.2
Product / Package Ecosystem Affected Versions Fixed Version
couchbase
PyPI
≥ 3.0.0
< 3.0.2
3.0.2

References

Frequently Asked Questions

What is CVE-2022-32563?
CVE-2022-32563 is a security vulnerability in Couchbase involving Couchbase Sync Gateway admin credentials not verified when using X.509 client cert authentication under CWE-295: Improper Certificate Validation.
Which Couchbase versions are affected?
Affected versions include releases prior to 3.0.2 across affected packages: couchbase.
What version fixes CVE-2022-32563?
Upgrading to 3.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is couchbase affected?
Yes, couchbase is affected in releases prior to 3.0.2. Upgrade your dependency to 3.0.2 or later.
What is the CVSS score of CVE-2022-32563?
CVE-2022-32563 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-32563?
CVE-2022-32563 is classified under CWE-295: Improper Certificate Validation (The product does not validate, or incorrectly validates, a certificate.).
How can I check PyPI dependencies for CVE-2022-32563?
Run the dependency tree command: 'pip show couchbase'. 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-9266-j9v3-q4j5",
  "modified" : "2024-09-13T18:30:10Z",
  "published" : "2022-06-11T00:00:36Z",
  "aliases" : [ "CVE-2022-32563" ],
  "summary" : "Couchbase Sync Gateway admin credentials not verified when using X.509 client cert authentication",
  "details" : "An issue was discovered in Couchbase Sync Gateway 3.x before 3.0.2. Admin credentials are not verified when using X.509 client-certificate authentication from Sync Gateway to Couchbase Server. When Sync Gateway is configured to authenticate with Couchbase Server using X.509 client certificates, the admin credentials provided to the Admin REST API are ignored, resulting in privilege escalation for unauthenticated users. The Public REST API is not impacted by this issue. A workaround is to replace X.509 certificate based authentication with Username and Password authentication inside the bootstrap configuration.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "couchbase"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.0.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-32563"
  }, {
    "type" : "WEB",
    "url" : "https://forums.couchbase.com/tags/security"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/couchbase/PYSEC-2022-207.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://www.couchbase.com/alerts"
  }, {
    "type" : "WEB",
    "url" : "https://www.couchbase.com/alerts/#CVE-2022-32563"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-295" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-24T21:38:00Z",
    "nvd_published_at" : "2022-06-10T12:15:00Z"
  }
}