VAITP Dataset

← Back to the dataset

CVE-2026-10300

SGLang `lora_path` manipulation in Inference Endpoint leads to an assertion.

  • CVSS 2.9
  • CWE-617
  • Input Validation and Sanitization
  • Remote

A security vulnerability has been detected in SGLang 0.5.10.post1. Impacted is an unknown function of the file python/sglang/srt/lora/lora_manager.py of the component Inference HTTP Endpoint. Such manipulation of the argument lora_path leads to reachable assertion. The attack can be launched remotely. A high complexity level is associated with this attack. The exploitability is considered difficult. The exploit has been disclosed publicly and may be used. The pull request to fix this issue awaits acceptance.

CVSS base score
2.9
Published
2026-06-01
OWASP
A03 Injection
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Input Validation and Sanitization
Subcategory
Path Traversal
Accessibility scope
Remote
Impact
Denial of Service (DoS)
Affected component
SGLang
Fixed by upgrading
Yes

Solution

As the fix is in a pending pull request, no patched version is available for upgrade at this time.

Vulnerable code sample

import os

class LoraManager:
    """A manager for LoRA weights."""

    def __init__(self):
        # In a real scenario, this would manage more complex state.
        self.loaded_loras = {}

    def add_lora(self, lora_path: str):
        """
        Adds a LoRA model from a given path.
        The path is expected to be in a 'user/repo' format.
        """
        # This function simulates the vulnerable logic where an assumption is
        # made about the format of 'lora_path'. The vulnerability lies in
        # using an assertion for input validation in a remotely-callable endpoint.
        # An attacker can provide a malformed 'lora_path' like "a" or "a/b/c"
        # to trigger the AssertionError and cause a denial of service.

        path_parts = lora_path.split("/")

        # VULNERABLE CODE: Reachable assertion via remote input
        assert len(path_parts) == 2, "LoRA path must be in 'user/repo' format."

        user, repo = path_parts
        print(f"Simulating loading of LoRA weights for {user}/{repo}...")
        
        # Further logic would go here, e.g., downloading and loading weights.
        lora_key = f"{user}-{repo}"
        self.loaded_loras[lora_key] = {"path": lora_path, "status": "loaded"}

        return True

# Example of how an HTTP endpoint might call this function:
# def handle_inference_request(request_data):
#     lora_path = request_data.get("lora_path") # Attacker controls this value
#     manager = LoraManager()
#     if lora_path:
#         manager.add_lora(lora_path) # This call triggers the vulnerability

Patched code sample

import os

def add_lora_adapter(lora_path: str, lora_base_dir: str):
    """
    Securely loads a LoRA adapter, preventing path traversal vulnerabilities.

    This function represents a fix for a vulnerability where a manipulated
    `lora_path` could lead to an assertion failure or arbitrary file access.
    """
    # 1. Resolve the base directory to its real, absolute path for a reliable root.
    real_base_dir = os.path.realpath(lora_base_dir)

    # 2. Join the base directory with the user-provided path and resolve the
    #    result to its canonical path. This step resolves any '..' components.
    full_lora_path = os.path.realpath(os.path.join(real_base_dir, lora_path))

    # 3. The crucial security check: Verify that the resolved path is still
    #    prefixed by the intended base directory.
    if not full_lora_path.startswith(real_base_dir):
        # Instead of crashing on an assertion, raise a specific, handled error.
        raise ValueError(
            f"Invalid lora_path: Path traversal attempt detected for '{lora_path}'"
        )

    # 4. Proceed with original logic only after the path has been validated.
    if not os.path.isfile(full_lora_path):
        raise FileNotFoundError(f"LoRA adapter file not found at '{full_lora_path}'")

    # ... code to load the LoRA adapter from the now-safe full_lora_path ...
    # print(f"Successfully and securely validated LoRA path: {full_lora_path}")

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:cve202610300,
  title        = {{SGLang `lora_path` manipulation in Inference Endpoint leads to an assertion.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-10300},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-10300/}}
}

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.