{"id":"UBUNTU-CVE-2021-42387","details":"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.","modified":"2026-02-04T04:33:56.988513Z","published":"2022-03-14T23:15:00Z","related":["USN-6933-1"],"upstream":["CVE-2021-42387"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2021-42387"},{"type":"REPORT","url":"https://github.com/ClickHouse/ClickHouse/commit/2aea1c8d4a5be320365472052d8a48bf69fd9fe9"},{"type":"REPORT","url":"https://github.com/ClickHouse/ClickHouse/commit/6d83eacec42c7c403c99804a713a9d38caa4a45d"},{"type":"REPORT","url":"https://github.com/ClickHouse/ClickHouse/pull/27136"},{"type":"REPORT","url":"https://jfrog.com/blog/7-rce-and-dos-vulnerabilities-found-in-clickhouse-dbms/"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2021-42387"},{"type":"ADVISORY","url":"https://ubuntu.com/security/notices/USN-6933-1"}],"affected":[{"package":{"name":"clickhouse","ecosystem":"Ubuntu:20.04:LTS","purl":"pkg:deb/ubuntu/clickhouse@18.16.1+ds-7ubuntu0.1?arch=source&distro=focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"18.16.1+ds-7ubuntu0.1"}]}],"versions":["18.16.1+ds-5","18.16.1+ds-5ubuntu1","18.16.1+ds-5ubuntu2","18.16.1+ds-6ubuntu1","18.16.1+ds-7"],"ecosystem_specific":{"availability":"No subscription required","binaries":[{"binary_name":"clickhouse-client","binary_version":"18.16.1+ds-7ubuntu0.1"},{"binary_name":"clickhouse-common","binary_version":"18.16.1+ds-7ubuntu0.1"},{"binary_version":"18.16.1+ds-7ubuntu0.1","binary_name":"clickhouse-server"},{"binary_name":"clickhouse-tools","binary_version":"18.16.1+ds-7ubuntu0.1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-42387.json"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H"},{"type":"Ubuntu","score":"medium"}]}