---
title: "CVE-2026-142206: PyPika - SQL Injection"
description: "PyPika <= 0.51.1 contains an sql injection caused by unescaped pattern arguments in ClickHouse search functions and ToFixedString, letting attackers inject SQL to bypass tenant filters or read other tables, exploit requires control over specific pattern inputs."
url: https://panop.io/threat-heartbeat/CVE-2026-142206/
---

# CVE-2026-142206 PyPika - SQL Injection

PyPika <= 0.51.1 contains an sql injection caused by unescaped pattern arguments in ClickHouse search functions and ToFixedString, letting attackers inject SQL to bypass tenant filters or read other tables, exploit requires control over specific pattern inputs.

CVSS base score 7.5 /10

High

CISA KEV

Not listed

Public exploit

None known

Authentication

Not required

[View the NVD record ↗](https://nvd.nist.gov/vuln/detail/CVE-2026-142206)

## Details

Type

SQL Injection

Impact

SQL Injection, Information Disclosure, Data Tampering

CVSS vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Published

2 December 2026

Updated

3 December 2026

Weakness

[CWE-89](https://cwe.mitre.org/data/definitions/89.html)

## Vendor fix

Update to the latest version beyond 0.51.1.

Patching closes this CVE. It does not tell you which of your systems run the affected version, or what else is exposed alongside them.

## References

- [https://nvd.nist.gov/vuln/detail/CVE-2026-142206](https://nvd.nist.gov/vuln/detail/CVE-2026-142206)
- [https://github.com/kayak/pypika/blob/v0.51.1/pypika/clickhouse/type\_conversion.py#L24-L30](https://github.com/kayak/pypika/blob/v0.51.1/pypika/clickhouse/type_conversion.py#L24-L30)
- [https://www.vulncheck.com/advisories/pypika-through-0.51.1-sql-injection-via-clickhouse-search-and-tofixedstring-functions](https://www.vulncheck.com/advisories/pypika-through-0.51.1-sql-injection-via-clickhouse-search-and-tofixedstring-functions)
- [https://github.com/kayak/pypika/blob/v0.51.1/pypika/clickhouse/search\_string.py#L20-L33](https://github.com/kayak/pypika/blob/v0.51.1/pypika/clickhouse/search_string.py#L20-L33)
- [https://github.com/kayak/pypika/blob/v0.51.1/pypika/clickhouse/search\_string.py#L64-L78](https://github.com/kayak/pypika/blob/v0.51.1/pypika/clickhouse/search_string.py#L64-L78)

[← All CVEs](https://panop.io/threat-heartbeat/)

## What this record can't tell you

- Whether you run the affected software, and where
- Whether an attacker can actually reach and exploit it
- The misconfigurations that never get a CVE number
- What it would cost the business, ranked into what to fix first

Panop answers these inside your environment, for this CVE and every other finding.

[Book a demo](https://panop.io/demo)
