CVE-2024-9710
Executive Summary
CVE-2024-9710 is a Server-Side Request Forgery (SSRF) vulnerability in PostHog's database_schema method, discovered by ZDI (ZDI-CAN-25351). This flaw allows an authenticated remote attacker to force the PostHog server to make arbitrary HTTP requests to internal or external resources, leading to information disclosure and potential code execution in the context of the service account. The vulnerability stems from improper validation of a URI before accessing resources. With a CVSS score of 7.1, it is considered high severity. No public exploit code or patch details are currently available, but the risk is significant due to the potential for lateral movement and data exfiltration.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
PostHog is a product analytics platform typically deployed via Docker, Helm charts, or source code from PyPI/npm. This vulnerability affects the core application logic, not a specific package dependency. However, organizations using PostHog should verify their deployment source and ensure no malicious packages have been introduced that could exploit this SSRF vector.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): Low (L) – Authentication is required, but any authenticated user can exploit.
- User Interaction (UI): None (N) – No user action needed.
- Scope (S): Unchanged (U) – The vulnerable component and the impacted component are the same.
- Confidentiality (C): High (H) – Sensitive internal data can be disclosed.
- Integrity (I): Low (L) – Limited ability to modify data.
- Availability (A): Low (L) – Potential for service disruption.
Threat Level: High. The combination of low attack complexity and high confidentiality impact makes this a priority for patching.
Deep Dive & Mechanics
The database_schema endpoint in PostHog is designed to retrieve and display the schema of connected databases. The vulnerability lies in how the endpoint processes user-supplied URIs. When a request is made to this endpoint, the application constructs a database connection string or query based on user input without properly sanitizing the URI. An attacker can craft a malicious URI that points to an internal service (e.g., http://169.254.169.254/latest/meta-data/ for cloud metadata) or an external server under their control.
The SSRF occurs because the application uses the user-supplied URI to make a server-side request. This can lead to:
- Information Disclosure: Access to internal services, cloud metadata, or other sensitive endpoints.
- Code Execution: If the attacker can chain this with another vulnerability (e.g., by accessing a service that allows command injection), they may execute arbitrary code as the service account.
The flaw is in the database_schema method, likely in the code that handles database introspection. The lack of a URI whitelist or proper validation allows the attacker to specify any protocol and host.
Vulnerable vs. Patched Code
Since no patch is available, the following is a hypothetical comparison based on common SSRF fixes.
Vulnerable Code (Python-like pseudocode):
def database_schema(request):
uri = request.POST.get('uri')
# No validation of uri
response = requests.get(uri)
return response.text
Patched Code (Hypothetical):
def database_schema(request):
uri = request.POST.get('uri')
# Validate URI against a whitelist
parsed = urlparse(uri)
if parsed.hostname not in ALLOWED_HOSTS:
raise PermissionError("URI not allowed")
# Also block internal IPs
if is_private_ip(parsed.hostname):
raise PermissionError("Internal resources not allowed")
response = requests.get(uri)
return response.text
The patched version would include a whitelist of allowed hosts and block requests to private IP ranges.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A valid PostHog account with authentication credentials.
- Network access to the PostHog instance.
Exploitation Steps:
- Identify the vulnerable endpoint: The
database_schemaendpoint is typically at/api/database_schemaor similar. - Craft a malicious request: Use a tool like
curlto send a POST request with a crafted URI.curl -X POST https://target.posthog.com/api/database_schema \ -H "Authorization: Bearer <token>" \ -d "uri=http://169.254.169.254/latest/meta-data/" - Exfiltrate data: The response will contain the cloud metadata, including IAM credentials.
- Escalate: Use the credentials to access other cloud resources.
Lab Setup:
- Deploy a vulnerable PostHog instance using Docker.
- Set up a listener (e.g.,
nc -lvnp 4444) to capture outbound requests. - Use the above curl command to trigger the SSRF.
Blue Team (Detection & Response)
Detection:
- Monitor for unusual outbound HTTP requests from the PostHog server to internal IPs (e.g., 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.169.254).
- Alert on requests to the
database_schemaendpoint with non-standard URIs.
Response:
- Immediately isolate the affected PostHog instance.
- Review logs for any data exfiltration.
- Rotate any credentials that may have been exposed.
Indicators of Compromise (IOCs)
- Network IOCs:
- Outbound HTTP requests to internal IP ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.169.254).
- Requests to known cloud metadata endpoints (e.g.,
169.254.169.254).
- Log IOCs:
- POST requests to
/api/database_schemawith unusualuriparameters. - Error logs indicating failed connection attempts to internal services.
- POST requests to
- File IOCs:
- Temporary files created in
/tmp/with names likessrf_*.
- Temporary files created in
Detection Engineering
YARA Rule
rule CVE_2024_9710_SSRF_PostHog {
meta:
description = "Detects SSRF exploitation attempts against PostHog database_schema endpoint"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-9710"
strings:
$uri_param = "uri=" nocase
$internal_ip = /(10\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.(1[6-9]|2[0-9]|3[0-1])\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3}|169\.254\.\d{1,3}\.\d{1,3})/
$metadata = "169.254.169.254" nocase
condition:
$uri_param and ($internal_ip or $metadata)
}
Sigma Rule
title: PostHog SSRF Exploitation via database_schema
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects SSRF attempts against PostHog's database_schema endpoint
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: posthog
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/api/database_schema'
cs-uri-query|contains: 'uri='
filter:
cs-uri-query|contains:
- 'uri=localhost'
- 'uri=127.0.0.1'
condition: selection and not filter
falsepositives:
- Legitimate database schema requests to allowed hosts
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-9710 PostHog SSRF Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"/api/database_schema"; http_uri;
content:"uri="; http_client_body;
pcre:"/uri=(https?:\/\/)(10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.|192\.168\.|169\.254\.)/Ri";
classtype:attempted-recon;
sid:1000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Disable the
database_schemaendpoint if not in use, or restrict access to trusted IPs only. - Apply network segmentation to prevent the PostHog server from accessing internal resources.
- Monitor logs for any signs of exploitation.
Long-term Fix:
- Apply the official patch once released by PostHog.
- Implement input validation and a whitelist of allowed URIs.
- Use a web application firewall (WAF) to block requests containing internal IP patterns.
Workaround:
- If patching is not possible, modify the application code to block requests to private IP ranges.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.