{"id":"CVE-2026-123818","kind":"vulnerability","aliases":["CVE-2026-123818","GHSA-39wr-7q6h-cf68"],"related":[],"title":"LMDeploy has an SSRF bypass","description":"### Summary\nThe URL checking logic in lmdeploy has a logical flaw that could be bypassed by attackers, leading to SSRF attacks.\n\n### Details\nThe current lmdeploy project uses `_is_safe_url` 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.\n<img width=\"943\" height=\"836\" alt=\"QQ20260416-203956-16-1\" src=\"https://github.com/user-attachments/assets/042faad1-7458-444a-bbc9-525c772b0a4d\" />\nHowever, 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 `_is_safe_url` for URL validation, and then using requests.Session().get to send the request.\n<img width=\"1086\" height=\"576\" alt=\"QQ20260416-204053-16-2\" src=\"https://github.com/user-attachments/assets/7ffb8a69-b155-483a-90be-016c53e6387a\" />\nThe core issue: `urlparse()` and `requests` disagree on which host a URL like `http://127.0.0.1:6666\\@1.1.1.1` points to:\n\n- `urlparse()` treats `\\` as a regular character and `@` as the userinfo-host delimiter, so it extracts hostname as 1.1.1.1 (public)\n- `requests` treats `\\` as a path character, connecting to `127.0.0.1` (internal)\n\nBelow is a test code I wrote following the code.\n```\nfrom urllib.parse import urlparse\nimport ipaddress\nimport socket\nimport requests\n\n\ndef _is_safe_url(url: str) -> tuple[bool, str]:\n    \"\"\"Check if the URL is safe to fetch (not internal/private).\"\"\"\n    try:\n        parsed = urlparse(url)\n        if parsed.scheme not in (\"http\", \"https\"):\n            return False, f\"Unsupported scheme: {parsed.scheme}\"\n\n        hostname = parsed.hostname\n        if not hostname:\n            return False, \"Could not parse hostname from URL\"\n\n        # check all IPs (IPv4 + IPv6) using getaddrinfo\n        try:\n            infos = socket.getaddrinfo(hostname, None)\n        except socket.gaierror:\n            return False, \"Hostname resolution failed\"\n\n        for info in infos:\n            ip = ipaddress.ip_address(info[4][0])\n            # block any IP that is not globally routable (covers private, loopback,\n            # link-local, multicast, reserved, unspecified, etc.)\n            if not ip.is_global:\n                return False, f\"Blocked non-global IP detected: {ip}\"\n\n        return True, \"URL is safe\"\n    except Exception as e:\n        return False, f\"URL validation failed: {str(e)}\"\n\n\n# url = \"http://127.0.0.1:6666\"\nurl = \"http://127.0.0.1:6666\\@1.1.1.1\"\nis_safe, reason = _is_safe_url(url)\nif not is_safe:\n    raise ValueError(f\"URL is blocked for security reasons: {reason}\")\n\nfetch_timeout = 10\n\nclient = requests.Session()\nclient.max_redirects = 3\nresponse = client.get(url, timeout=fetch_timeout, allow_redirects=True)\n```\nWhen 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.\n<img width=\"1286\" height=\"195\" alt=\"QQ20260416-204234-16-3\" src=\"https://github.com/user-attachments/assets/b921ff01-3b9f-49a5-a410-bd21fe42f9c9\" />\nHowever, 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.\n\n<img width=\"2064\" height=\"154\" alt=\"QQ20260416-204319-16-4\" src=\"https://github.com/user-attachments/assets/5da18f35-f400-46e6-9bf3-1330ba424b02\" />\n\n### PoC\n```\nhttp://127.0.0.1:6666\\@1.1.1.1\n```\n\n### Impact\nSSRF","summary":"LMDeploy's URL safety check parses a crafted URL to a public host, while the HTTP client connects to a loopback address, so a remote attacker can make the server fetch internal resources (SSRF). The impact stated in the advisory is server-side request forgery.","severity":"high","cvss":7.5,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"lmdeploy","fixed":["0.15.0"],"affected":">= 0.12.3, < 0.15.0","ecosystem":"pypi"}],"ecosystems":["pypi"],"tags":["cwe-436","cwe-918","lmdeploy","package","python","self-hosted"],"not_affected_if":["no-user-supplied-urls","version-0.15.0-or-later"],"how_to_check":"- Check the installed version: `pip show lmdeploy`\n- Look for calls to `_is_safe_url` followed by `requests` fetches on user-supplied URLs in your LMDeploy deployment\n- Confirm whether the service accepts URLs from untrusted input","fix":"- `lmdeploy` `0.15.0` (fixed version per the product data; affected range `>= 0.12.3, < 0.15.0`)","status":"open","published_at":"2026-09-18T17:14:06+00:00","first_seen_at":"2026-11-09T21:24:42+00:00","triaged_at":"2026-11-09T21:25:13+00:00","updated_at":"2026-11-09T21:25:13+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-11-09T21:25:13Z","model":"claude-haiku-5-5","output":{"fix":"- `lmdeploy` `0.15.0` (fixed version per the product data; affected range `>= 0.12.3, < 0.15.0`)","reach":"internet","title":"LMDeploy: URL check can be bypassed to reach internal hosts","impact":"medium","summary":"LMDeploy's URL safety check parses a crafted URL to a public host, while the HTTP client connects to a loopback address, so a remote attacker can make the server fetch internal resources (SSRF). The impact stated in the advisory is server-side request forgery.","audience":"developers","category":"package","nicknames":[],"who_cares":["lmdeploy","python","self-hosted"],"confidence":0.8,"fix_status":"available","needs_auth":"unknown","worst_case":"Server fetches internal services on attacker's behalf","analyst_note":"","how_to_check":"- Check the installed version: `pip show lmdeploy`\n- Look for calls to `_is_safe_url` followed by `requests` fetches on user-supplied URLs in your LMDeploy deployment\n- Confirm whether the service accepts URLs from untrusted input","plain_action":"","product_name":"","needs_analyst":false,"not_affected_if":["no-user-supplied-urls","version-0.15.0-or-later"],"who_is_affected":"Teams that run LMDeploy 0.12.3 up to but not including 0.15.0 and let users supply URLs that the server fetches. The flaw sits in the URL validation path, so deployments that never fetch user-supplied URLs are less exposed. unknown whether other code paths are affected.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"unknown","severity_if_unknown":"high"},"cost_usd":0.000895,"input_tokens":5991,"output_tokens":592,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-123818':8A,16A '-2026':7A,15A '-436':19B '-918':21B '0':318C '1.1.1.1':189C,210C,374C,442C,450C,487C '10':398C '127.0.0.1':187C,220C,369C,372C,417C,440C,474C,485C '3':403C '39wr':11A '4':317C '6666':188C,370C,373C,418C,441C,475C,486C '7q6h':12A 'achiev':480C 'actual':144C,464C 'address':49B,315C,431C,456C 'advisori':67B 'allow':410C 'almost':149C 'applic':151C 'attack':53B,90C,94C,130C,415C,438C,483C 'block':319C,344C,391C,433C 'bool':249C 'bypass':5A,88C,476C 'cf68':13A 'charact':197C,217C 'check':32B,77C,116C,251C,290C 'client':44B,399C 'client.get':405C 'client.max':401C 'code':226C,231C 'connect':45B,218C 'core':175C 'could':86C,284C 'cover':327C 'craft':35B 'current':97C,148C 'cve':6A,14A 'cwe':18B,20B 'def':242C 'delimit':204C 'detail':95C 'detect':349C,421C,424C,444C,478C 'differ':135C 'disagre':180C 'e':359C,367C 'etc':336C 'except':302C,356C,357C 'exist':420C 'extract':124C,207C 'f':273C,343C,362C,388C 'fail':308C,365C 'fals':272C,283C,305C,342C,361C 'fetch':58B,258C,396C,408C 'first':157C 'flaw':84C 'follow':229C 'forgeri':73B 'forward':470C 'get':169C 'getaddrinfo':296C 'ghsa':10A 'ghsa-39wr-7q6h-cf68':9A 'global':325C,340C,347C 'host':27B,40B,119C,183C,203C,448C 'hostnam':208C,277C,281C,287C,300C,306C 'howev':131C,435C 'http':43B,269C 'https':270C 'impact':63B,488C 'import':234C,236C,238C,240C 'inde':134C 'info':298C,310C,312C,316C 'input':107C 'intern':59B,221C,429C 'internal/private':260C 'involv':156C 'ip':292C,313C,321C,348C,350C,455C 'ip.is':339C 'ipaddress':237C 'ipaddress.ip':314C 'ipv4':293C 'ipv6':294C 'issu':176C 'lead':91C 'librari':142C 'like':186C 'link':331C 'link-loc':330C 'lmdeploy':1A,17A,22B,28B,80C,98C 'local':332C 'logic':78C,83C,111C,422C,445C 'loopback':48B,329C 'main':110C 'make':55B 'multicast':333C 'network':430C 'non':346C 'non-glob':345C 'none':301C 'packag':23B 'pars':33B,137C,262C,286C 'parsed.hostname':278C 'parsed.scheme':266C,276C 'pass':458C 'path':216C 'perform':114C 'poc':484C 'point':190C 'portion':120C 'prevent':128C 'privat':328C 'process':466C 'project':99C,155C 'public':39B,211C,454C 'python':24B 'rais':386C 'reason':377C,394C,395C 'redirect':402C,411C 'regular':196C 'remot':52B 'request':72B,147C,173C,179C,212C,241C,465C 'requests.get':472C 'requests.session':168C,400C 'reserv':334C 'resolut':307C 'resolv':446C 'resourc':60B 'respons':404C 'return':271C,282C,304C,341C,351C,360C 'routabl':326C 'safe':102C,160C,244C,256C,355C,376C,379C,385C 'safeti':31B 'scenario':152C 'scheme':275C 'secur':115C,393C 'self':26B 'self-host':25B 'send':145C,171C 'server':57B,70B 'server-sid':69B 'side':71B 'socket':239C 'socket.gaierror':303C 'socket.getaddrinfo':299C 'ssrf':4A,61B,93C,129C,482C,489C 'state':64B 'str':247C,250C,366C 'summari':74C 'test':225C 'thus':457C 'timeout':397C,407C,409C 'treat':193C,213C 'tri':261C,297C 'true':352C,412C 'tupl':248C 'unspecifi':335C 'unsupport':274C 'url':30B,36B,76C,103C,108C,123C,161C,163C,185C,245C,246C,254C,264C,289C,353C,363C,368C,371C,380C,381C,389C,406C,468C 'urllib.parse':233C 'urlpars':126C,139C,177C,192C,235C,263C 'use':100C,158C,167C,295C,416C,439C 'userinfo':202C 'userinfo-host':201C 'valid':105C,164C,364C 'valueerror':387C 'verif':460C 'wrote':228C","nicknames":[],"mitigations":[],"who_affected":"Teams that run LMDeploy 0.12.3 up to but not including 0.15.0 and let users supply URLs that the server fetches. The flaw sits in the URL validation path, so deployments that never fetch user-supplied URLs are less exposed. unknown whether other code paths are affected.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":["lmdeploy"],"ptokens":["lmdeploy"],"labels":["cwe436","cwe918","high","lmdeploy","package","pypi","python","selfhosted"],"campaign_type":null,"search_a":"'-123818':8A,16A '-2026':7A,15A '39wr':11A '7q6h':12A 'bypass':5A 'cf68':13A 'cve':6A,14A 'ghsa':10A 'ghsa-39wr-7q6h-cf68':9A 'lmdeploy':1A,17A 'ssrf':4A","search_b":"'-436':19B '-918':21B 'address':49B 'advisori':67B 'attack':53B 'check':32B 'client':44B 'connect':45B 'craft':35B 'cwe':18B,20B 'fetch':58B 'forgeri':73B 'host':27B,40B 'http':43B 'impact':63B 'intern':59B 'lmdeploy':22B,28B 'loopback':48B 'make':55B 'packag':23B 'pars':33B 'public':39B 'python':24B 'remot':52B 'request':72B 'resourc':60B 'safeti':31B 'self':26B 'self-host':25B 'server':57B,70B 'server-sid':69B 'side':71B 'ssrf':61B 'state':64B 'url':30B,36B","search_c":"'0':318C '1.1.1.1':189C,210C,374C,442C,450C,487C '10':398C '127.0.0.1':187C,220C,369C,372C,417C,440C,474C,485C '3':403C '4':317C '6666':188C,370C,373C,418C,441C,475C,486C 'achiev':480C 'actual':144C,464C 'address':315C,431C,456C 'allow':410C 'almost':149C 'applic':151C 'attack':90C,94C,130C,415C,438C,483C 'block':319C,344C,391C,433C 'bool':249C 'bypass':88C,476C 'charact':197C,217C 'check':77C,116C,251C,290C 'client':399C 'client.get':405C 'client.max':401C 'code':226C,231C 'connect':218C 'core':175C 'could':86C,284C 'cover':327C 'current':97C,148C 'def':242C 'delimit':204C 'detail':95C 'detect':349C,421C,424C,444C,478C 'differ':135C 'disagre':180C 'e':359C,367C 'etc':336C 'except':302C,356C,357C 'exist':420C 'extract':124C,207C 'f':273C,343C,362C,388C 'fail':308C,365C 'fals':272C,283C,305C,342C,361C 'fetch':258C,396C,408C 'first':157C 'flaw':84C 'follow':229C 'forward':470C 'get':169C 'getaddrinfo':296C 'global':325C,340C,347C 'host':119C,183C,203C,448C 'hostnam':208C,277C,281C,287C,300C,306C 'howev':131C,435C 'http':269C 'https':270C 'impact':488C 'import':234C,236C,238C,240C 'inde':134C 'info':298C,310C,312C,316C 'input':107C 'intern':221C,429C 'internal/private':260C 'involv':156C 'ip':292C,313C,321C,348C,350C,455C 'ip.is':339C 'ipaddress':237C 'ipaddress.ip':314C 'ipv4':293C 'ipv6':294C 'issu':176C 'lead':91C 'librari':142C 'like':186C 'link':331C 'link-loc':330C 'lmdeploy':80C,98C 'local':332C 'logic':78C,83C,111C,422C,445C 'loopback':329C 'main':110C 'multicast':333C 'network':430C 'non':346C 'non-glob':345C 'none':301C 'pars':137C,262C,286C 'parsed.hostname':278C 'parsed.scheme':266C,276C 'pass':458C 'path':216C 'perform':114C 'poc':484C 'point':190C 'portion':120C 'prevent':128C 'privat':328C 'process':466C 'project':99C,155C 'public':211C,454C 'rais':386C 'reason':377C,394C,395C 'redirect':402C,411C 'regular':196C 'request':147C,173C,179C,212C,241C,465C 'requests.get':472C 'requests.session':168C,400C 'reserv':334C 'resolut':307C 'resolv':446C 'respons':404C 'return':271C,282C,304C,341C,351C,360C 'routabl':326C 'safe':102C,160C,244C,256C,355C,376C,379C,385C 'scenario':152C 'scheme':275C 'secur':115C,393C 'send':145C,171C 'socket':239C 'socket.gaierror':303C 'socket.getaddrinfo':299C 'ssrf':93C,129C,482C,489C 'str':247C,250C,366C 'summari':74C 'test':225C 'thus':457C 'timeout':397C,407C,409C 'treat':193C,213C 'tri':261C,297C 'true':352C,412C 'tupl':248C 'unspecifi':335C 'unsupport':274C 'url':76C,103C,108C,123C,161C,163C,185C,245C,246C,254C,264C,289C,353C,363C,368C,371C,380C,381C,389C,406C,468C 'urllib.parse':233C 'urlpars':126C,139C,177C,192C,235C,263C 'use':100C,158C,167C,295C,416C,439C 'userinfo':202C 'userinfo-host':201C 'valid':105C,164C,364C 'valueerror':387C 'verif':460C 'wrote':228C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-09-18T17:14:06+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-39wr-7q6h-cf68","url":"https://github.com/advisories/GHSA-39wr-7q6h-cf68","severity":"high","published_at":"2026-09-18T17:14:06+00:00","modified_at":"2026-11-09T21:20:00+00:00","first_seen_at":"2026-11-09T21:24:42+00:00","fetched_at":"2026-11-09T21:28:56+00:00","note":null}],"documents":[{"id":110082,"url":"https://api.github.com/repos/InternLM/lmdeploy/security-advisories/GHSA-39wr-7q6h-cf68","title":"Maintainer's advisory: api.github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: api.github.com"},{"id":110083,"url":"https://github.com/InternLM/lmdeploy/security/advisories/GHSA-39wr-7q6h-cf68","title":"Maintainer's advisory: github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: github.com"},{"id":110084,"url":"https://github.com/InternLM/lmdeploy/releases/tag/v0.15.0","title":"Release: github.com","kind":"release","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Release: github.com"}],"disclosures":[],"exploit_sources":[],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}