CVE-2025-1520:
PostHog Plugin Server SQL Injection Vulnerability
7.1
Basic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
@posthog/plugin-server | npm | <= 1.10.7 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability is described as a PostHog Plugin Server SQL Injection. The provided commit (6e8f035f9acd339c5ba87ba6ea40fc1ab3053d42) modifies the trackedFetch
function in plugin-server/src/utils/fetch.ts
. This commit primarily implements an SSRF (Server-Side Request Forgery) mitigation by adding a custom DNS lookup (staticLookup
) to restrict fetch operations to unicast
IP addresses, preventing access to internal services.
Although the commit directly addresses SSRF, it is linked by advisories (e.g., GHSA-v64v-fq96-c5wv) as the fix for the described SQL injection vulnerability. This implies that the SSRF vector exploitable via trackedFetch
was a prerequisite or pathway to the SQL injection. The trackedFetch
function processes a user-supplied URL. In its pre-patch state, it lacked sufficient restrictions on where it could fetch data from in production environments. This allowed an attacker to potentially specify a URL that, when fetched, would return malicious data. This data (or parts of the URL itself) could then be used insecurely in downstream SQL query construction, leading to SQL injection, as per the vulnerability description regarding 'lack of proper validation of a user-supplied string'.
Therefore, trackedFetch
is identified as the vulnerable function because it processed potentially malicious user input (the URL) in a way that could lead to the SQL injection. The patch hardens trackedFetch
against SSRF, which in turn closes off the identified vector for the SQL injection. The confidence is 'medium' because the commit directly shows an SSRF fix, and its connection to SQL injection is based on the advisory linking and the inference that fetched content was the source of the SQL injection string. No SQL parsing or query construction functions are directly modified in this commit, suggesting trackedFetch
was an entry point for the malicious data rather than the site of the SQL parsing flaw itself.