The analysis is based on a detailed technical blog post from Antiproof, as the vulnerable code and the corresponding patch were not found in the provided repository information. The blog post describes a path traversal vulnerability (CVE-2026-7302) in SGLang's multimodal generation runtime.
The vulnerability exists in the file upload functionality for the OpenAI-compatible endpoints /v1/images/edits and /v1/videos. The root cause is the lack of sanitization of the user-provided filename in a multipart upload request.
The blog post identifies a helper function, _save_upload_to_path, that performs the file write operation. This function is inherently dangerous as it trusts the target_path argument completely. The calling code, which is the endpoint handler for the image and video editing endpoints, constructs this target_path by concatenating a base directory with the unsanitized filename from the upload. This allows an attacker to craft a filename like ../../../../tmp/pwned.txt to write a file to an arbitrary location on the server's filesystem, limited only by the process's write permissions.
Two main functions are identified as part of the vulnerability:
- The endpoint handlers (inferred name
openai_v1_images_edits and a similar one for videos) that receive the upload and construct the malicious path.
- The
_save_upload_to_path function that performs the arbitrary file write.
Both of these functions would appear in a runtime profile or stack trace during the exploitation of this vulnerability.