# CVE-2021-42387: Heap out-of-bounds read in Clickhouse's LZ4 compression codec when parsing a malicious query.

- Severity: High 8.1 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.57%, higher than 76% of CVEs (2026-11-30)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-03-14T00:00:00.000Z
- Modified: 2026-06-17T04:09:44.877Z
- Weaknesses: CWE-125
- Assigned by: JFROG

## Description

Heap out-of-bounds read in Clickhouse's LZ4 compression codec when parsing a malicious query. As part of the LZ4::decompressImpl() loop, a 16-bit unsigned user-supplied value ('offset') is read from the compressed data. The offset is later used in the length of a copy operation, without checking the upper bounds of the source of the copy operation.

(As written by CVE List.)

## Affected

- yandex clickhouse: from unspecified before 21.10.2.15-stable
- clickhouse clickhouse: before 21.10.2.15
- debian debian_linux: 10.0

## Every score

- NVD: CVSS:3.1 8.1 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`
- NVD: CVSS:2.0 5.5 Medium `AV:N/AC:L/Au:S/C:P/I:N/A:P`

## References

- <https://jfrog.com/blog/7-rce-and-dos-vulnerabilities-found-in-clickhouse-dbms> (exploit, third-party-advisory)
- <https://lists.debian.org/debian-lts-announce/2022/11/msg00002.html> (mailing-list, third-party-advisory)

## Sources

- CVE List: [CVE-2021-42387](https://www.cve.org/CVERecord?id=CVE-2021-42387), CVE Terms of Use, modified 2024-08-04
- NVD: [CVE-2021-42387](https://nvd.nist.gov/vuln/detail/CVE-2021-42387), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-42387 · Whole record: https://cve.day/CVE-2021-42387.json · Rebuilt by cve.day 2026-11-25T22:58:07.193Z
