# CVE-2022-32531: Apache BookKeeper: Java Client Uses Connection to Host that Failed Hostname Verification

> Apache BookKeeper Java client fails to close connections on TLS hostname verification errors, enabling man-in-the-middle attacks.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 Dec 2022
- **Updated:** 17 Apr 2025
- **Also known as:** GHSA-gxq5-79m2-gvvq, PYSEC-2022-43060, UBUNTU-CVE-2022-32531

## What is CVE-2022-32531?

CVE-2022-32531 is a medium-severity vulnerability in Apache BookKeeper, published on 15 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The Apache Bookkeeper Java Client (before 4.14.6 and also 4.15.0) does not close the connection to the bookkeeper server when TLS hostname verification fails. This leaves
the bookkeeper client vulnerable to a man in the middle attack.

The problem affects BookKeeper client prior to versions 4.14.6 and 4.15.1.

Weakness: CWE-295 (Improper Certificate Validation)

## Which versions are affected by CVE-2022-32531?

5 open source packages ship an affected version, including org.apache.bookkeeper:bookkeeper-common and apache-bookkeeper-client. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache.bookkeeper:bookkeeper-common` | Maven | All versions | 4.14.6 |
| `org.apache.bookkeeper:bookkeeper-common` | Maven | All versions | 4.14.6 |
| `org.apache.bookkeeper:bookkeeper-common` | Maven | From 4.15.0 | 4.15.1 |
| `org.apache.bookkeeper:bookkeeper-common` | Maven | From 4.15.0 | 4.15.1 |
| `apache-bookkeeper-client` | PyPI | All versions | 4.14.6 |

Products: Apache Bookkeeper.

## How do I fix CVE-2022-32531?

Upgrade org.apache.bookkeeper:bookkeeper-common to a fixed version for your release line: 4.14.6 or 4.15.1.

## Is CVE-2022-32531 being exploited?

There is no known exploitation of CVE-2022-32531 in the wild and no public exploit code.

## Other vulnerabilities in Apache BookKeeper

- [CVE-2019-17571](https://insights.sbomify.com/CVE-2019-17571/): Deserialization of Untrusted Data in Log4j (critical 9.8)
- [CVE-2017-6891](https://insights.sbomify.com/CVE-2017-6891/): Memory corruption in GnuTLS libtasn1 (high 8.8)
- [CVE-2020-36230](https://insights.sbomify.com/CVE-2020-36230/): A flaw was discovered in OpenLDAP before 2.4.57 leading in an assertion failure in slapd in the X.509 DN parsing in decode.c ber_next_elemen (high 7.5)
- [CVE-2019-19906](https://insights.sbomify.com/CVE-2019-19906/): Memory corruption in n/a (high 7.5)
- [CVE-2020-23922](https://insights.sbomify.com/CVE-2020-23922/): Memory corruption in n/a (high 7.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-32531 and fix it if it is affected.

What it is: CVE-2022-32531 is a medium-severity vulnerability in Apache BookKeeper, published on 15 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-32531 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.apache.bookkeeper:bookkeeper-common (Maven): affected all versions; fixed in 4.14.6
- org.apache.bookkeeper:bookkeeper-common (Maven): affected all versions; fixed in 4.14.6
- org.apache.bookkeeper:bookkeeper-common (Maven): affected from 4.15.0; fixed in 4.15.1
- org.apache.bookkeeper:bookkeeper-common (Maven): affected from 4.15.0; fixed in 4.15.1
- apache-bookkeeper-client (PyPI): affected all versions; fixed in 4.14.6

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-32531/ (Markdown: https://insights.sbomify.com/CVE-2022-32531/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-32531
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-32531
- OSV: https://osv.dev/vulnerability/CVE-2022-32531

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-32531/
Summaries are generated and may contain mistakes; the official description above is the record.
