CVE-2026-105245
Cleartext API key leak via HTTP endpoint’s server_info function.
- CVSS 2.9
- CWE-310
- Information Leakage
- Remote
A vulnerability has been found in sgl-project sglang up to 0.5.21. This issue affects the function server_info of the file python/sglang/srt/entrypoints/http_server.py of the component HTTP Endpoint. Such manipulation of the argument api_key leads to cleartext transmission of sensitive information. It is possible to launch the attack remotely. Attacks of this nature are highly complex. The exploitability is assessed as difficult. The exploit has been disclosed to the public and may be used. The pull request to fix this issue awaits acceptance.
- CWE
- CWE-310
- CVSS base score
- 2.9
- Published
- 2026-10-05
- OWASP
- A02 Cryptographic Failures
- Orthogonal defect classification
- Interface
- Code defect classification
- Incorrect Interface
- Category
- Information Leakage
- Subcategory
- Insecure Handling of Sensitive Data
- Accessibility scope
- Remote
- Impact
- Information Disclosure
- Affected component
- sglang
- Fixed by upgrading
- Yes
Solution
Upgrade sglang to version 0.5.22 or later, which includes the fix for the cleartext api_key exposure in server_info.
Vulnerable code sample
import json
from http.server import BaseHTTPRequestHandler, HTTPServer
class SrtHttpHandler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path.startswith("/server_info"):
self.server_info()
else:
self.send_response(404)
self.end_headers()
# VULNERABLE: returns api_key in cleartext response
def server_info(self):
# In the real implementation this reads the api_key from config
api_key = self.server.config.get("api_key", "")
info = {
"status": "ok",
"api_key": api_key, # exposed
}
self.send_response(200)
self.send_header("Content-Type", "application/json")
self.end_headers()
self.wfile.write(json.dumps(info).encode())
def run_server():
config = {"api_key": "super-secret-key-123"}
server = HTTPServer(("0.0.0.0", 8080), SrtHttpHandler)
server.config = config
server.serve_forever()Patched code sample
import json
from http.server import BaseHTTPRequestHandler, HTTPServer
class SrtHttpHandler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path.startswith("/server_info"):
self.server_info()
else:
self.send_response(404)
self.end_headers()
# FIX: omit api_key from cleartext response
def server_info(self):
# The api_key remains internal; not sent to client
info = {
"status": "ok",
# "api_key" omitted to prevent leakage
}
self.send_response(200)
self.send_header("Content-Type", "application/json")
self.end_headers()
self.wfile.write(json.dumps(info).encode())
def run_server():
config = {"api_key": "super-secret-key-123"}
server = HTTPServer(("0.0.0.0", 8080), SrtHttpHandler)
server.config = config
server.serve_forever()Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- [Fix] Redact api_key/admin_api_key/ssl_keyfile_password from server info endpoints (sgl-project/sglang)
python/sglang/srt/entrypoints/engine.py · Engine.get_server_info,python/sglang/srt/entrypoints/grpc_bridge.py,python/sglang/srt/entrypoints/grpc_bridge.py · RuntimeHandle.get_server_info,python/sglang/srt/entrypoints/http_server.py · server_info,python/sglang/srt/server_args.py
Cite this entry
@misc{vaitp:cve2026105245,
title = {{Cleartext API key leak via HTTP endpoint’s server_info function.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-105245},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-105245/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
