VAITP Dataset

← Back to the dataset

CVE-2026-111391

Code injection in SGLang 0.5.10‑0.5.22 via crafted filter bypassing eval sandbox.

  • CVSS 9.2
  • CWE-95
  • Input Validation and Sanitization
  • Remote

SGLang 0.5.10 through 0.5.22 contains a code injection vulnerability in _evaluate_filter() that allows remote attackers to execute Python code by escaping the eval() sandbox through re.search __globals__. Attackers can send a crafted filter expression to the unauthenticated /dumper/configure endpoint when DUMPER_SERVER_PORT is set, running code in the scheduler process on the next forward pass.

CVSS base score
9.2
Published
2026-10-16
OWASP
A03 Injection
Orthogonal defect classification
Checking
Code defect classification
Incorrect Check
Category
Input Validation and Sanitization
Subcategory
Command Injection
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
SGLang
Fixed by upgrading
Yes

Solution

Upgrade SGLang to version 0.5.23 or newer, which patches the _evaluate_filter() code‑injection flaw.

Vulnerable code sample

import re

class Configurator:
    def __init__(self):
        self.allowed_keys = {"mode", "threshold"}

    def _evaluate_filter(self, filter_expr: str) -> bool:
        # VULNERABLE: eval with unrestricted globals allows __globals__ escape
        return eval(filter_expr, {"re": re})

    def configure(self, payload: dict):
        filter_expr = payload.get("filter", "True")
        if self._evaluate_filter(filter_expr):
            for k, v in payload.get("settings", {}).items():
                if k in self.allowed_keys:
                    setattr(self, k, v)

Patched code sample

import re
import ast

class Configurator:
    def __init__(self):
        self.allowed_keys = {"mode", "threshold"}

    def _evaluate_filter(self, filter_expr: str) -> bool:
        # FIX: use ast.literal_eval to prevent code execution
        try:
            result = ast.literal_eval(filter_expr)
            if isinstance(result, bool):
                return result
        except Exception:
            pass
        # fallback for simple regex checks without eval
        return bool(re.search(filter_expr, ""))

    def configure(self, payload: dict):
        filter_expr = payload.get("filter", "True")
        if self._evaluate_filter(filter_expr):
            for k, v in payload.get("settings", {}).items():
                if k in self.allowed_keys:
                    setattr(self, k, v)

Cite this entry

@misc{vaitp:cve2026111391,
  title        = {{Code injection in SGLang 0.5.10‑0.5.22 via crafted filter bypassing eval sandbox.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-111391},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-111391/}}
}

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.