Severity:

CRITICAL RISK

(9.1)

Path Traversal in SGLangs Multimodal Generation Runtime

CVE-2026-7302

Analyzed

Vulnerability type

Category:

Path Traversal / Directory Traversal

CWE:

CWE-35

Impact:

Arbitrary File Write

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

SGLangs multimodal generation runtime contains an unauthenticated path traversal flaw in its file upload handling, where ../ sequences in upload filenames are not properly sanitized.

An attacker can abuse this to write arbitrary files anywhere the server process has write permission, potentially enabling web shell placement, data tampering, or service disruption without prior authentication.

Affected context

The vulnerability occurs in SGLangs multimodal generation runtime when specific upload endpoints accept client-supplied filenames and use them directly to construct filesystem paths.

In deployments where the runtime:

  • Exposes these upload endpoints to untrusted networks, and
  • Runs with write access to sensitive directories (application code, configuration, or data paths),

the lack of robust path normalization and enforcement of allowed directories lets an attacker escape the intended upload folder via ../ (dot-dot) sequences and write files elsewhere on the filesystem.

Exploit preconditions

  • Attack surface: Network-accessible upload endpoints in the SGLangs multimodal generation runtime.
  • Required access: None; the issue is described as unauthenticated, so any network client reaching the endpoints can attempt exploitation.
  • Trigger point: Submission of a crafted upload request where the filename includes ../ segments (or similar traversal patterns) pointing outside the expected upload directory.
  • Why exploitation is possible: The server trusts the client-provided filename when constructing filesystem paths, failing to normalize, validate, and constrain the final path to a safe, application-controlled directory.

Why this happens

This issue is a classic path traversal problem aligned with CWE-35: Path Traversal, in which user-controlled input influences filesystem paths without sufficient validation.

Instead of treating filenames as untrusted data that must be strictly constrained to an allowed directory, the runtime appears to concatenate or otherwise combine the client-supplied name directly with a base path.

Without strong normalization (resolving ../, symbolic links, and absolute paths) and enforcement of a fixed root directory, attackers can escape the intended upload location and write files in arbitrary locations where the server has permissions.

Potential impact

  • Attackers may write executable files or scripts into web-accessible or runtime-loaded directories, potentially achieving remote code execution.
  • Configuration files or model artifacts could be overwritten or replaced, leading to model poisoning, logic changes, or degraded service behavior.
  • Log files or audit trails could be tampered with, complicating incident response and masking malicious activity.
  • Critical system or application data may be corrupted or deleted if the process has write access to those locations.
  • The host or container environment could be further compromised if the application runs with elevated privileges and write access to sensitive system paths.

General mitigation guidance

Effective mitigation centers on treating all client-supplied filenames and paths as untrusted data and strictly limiting where files can be written:

  • Enforce a fixed, application-controlled upload directory and never allow client input to influence parent directories or absolute paths.
  • Normalize and canonicalize paths before use, then verify that the resolved path remains within an approved directory tree.
  • Reject filenames containing path separators, ../ sequences, absolute path prefixes, or other traversal constructs; use server-generated filenames instead of trusting user input where possible.
  • Run the runtime under an account with minimal filesystem permissions so that even if path validation fails, an attacker cannot write into sensitive locations.
  • Consider isolating upload handling in a separate process, container, or chroot-like environment with restricted filesystem visibility.

How teams detect issues like this

Detection approaches can combine code-centric and operational techniques:

  • Static analysis: Search for file write operations that incorporate unsanitized request parameters into filesystem paths (e.g., concatenation of user input with base directories, use of raw filenames from HTTP headers or form fields).
  • Code review: Flag any use of client-controlled filenames without explicit normalization and a post-normalization check that the resulting path remains within a designated upload directory.
  • Runtime monitoring: Enable logging for upload endpoints, including normalized paths; alert on suspicious patterns such as ../, absolute paths, or writes to unexpected directories.
  • Policy enforcement: Use automated code scanning or CI pipeline checks to enforce secure file handling patterns and prevent merges that introduce unchecked path construction logic.

Sources

SourceLink
antiproof.aiantiproof.ai/blog/three-rces-in-sglang/
github.comgithub.com/sgl-project/sglang/tree/main/python/sglang

Frequently asked

questions

Yes. Because the vulnerability affects network-exposed upload endpoints and is described as unauthenticated, any remote client that can reach these endpoints can potentially exploit the issue.

No explicit authentication is required according to the description. The main prerequisite is network access to the affected endpoints; no prior login or special role is needed.

The safest approach is to decouple user input from filesystem paths: use a fixed upload directory, generate server-side filenames, normalize any paths, and enforce that the canonical path cannot escape the allowed directory. Layer this with strict filesystem permissions and process isolation.

Adopt secure file handling patterns as a coding standard: treat all filenames as untrusted, avoid direct concatenation of paths with user input, require canonicalization and containment checks, and incorporate automated checks and peer review focused on filesystem access code.

Find out what's already
exploitable in your codebase.