Description
PyPika through 0.51.1 contains an sql injection vulnerability that allows attackers to inject SQL through unescaped pattern arguments in ClickHouse search functions and ToFixedString. Attackers controlling Match, Like, NotLike, MultiSearchAny, MultiMatchAny patterns or ToFixedString values can close string literals to bypass tenant filters or read other tables.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Kayak | PyPika | 0 ≤0.51.1 | — |
References
- 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/type_conversion.py#L24-L30
- https://www.vulncheck.com/advisories/pypika-through-0.51.1-sql-injection-via-clickhouse-search-and-tofixedstring-functions