Skip to content
SQL injection Advisory Advanced CVE-2025-1520

PostHog ClickHouse Table Functions SQL Injection Remote Code Execution Vulnerability

The SQL parser in PostHog did not properly validate a user-supplied string before using it to build SQL queries. An authenticated attacker could exploit this to execute code in the context of the database account.

Mehmet INCE Follow

Originally disclosed on Zero Day Initiative

High 7.1 View original

This vulnerability allows network-adjacent attackers to execute arbitrary code on affected installations of PostHog. Authentication is required to exploit this vulnerability.

Mehmet INCE (@mdisec) from PRODAFT.com, on the Zero Day Initiative

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the SQL parser passed user-supplied input into ClickHouse table functions without validating or restricting it, allowing injected SQL to reach dangerous functions.

Impact

An authenticated, network-adjacent attacker could execute arbitrary code in the context of the database account; the text does not say whether any defence limited the exploit.

What the attacker needed

Authentication required; network-adjacent access

The fix

The vulnerability was fixed in an update issued by PostHog.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

PostHog is an analytics tool that stores data in a database called ClickHouse. The software took text from a user and put it into a database command without checking it first, so a logged-in user could sneak in extra commands. That let them run their own code on the database server rather than just reading data.

What is SQL injection?

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.

More by Mehmet INCE

View all

18 more disclosed reports, best first.

More from Zero Day Initiative

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.