VAITP Dataset

← Back to the dataset

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.

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.

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/}}
}

Download this entry as JSON Download the whole dataset

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 ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.