Summary
CVE-2026-51861 is a critical code injection vulnerability (CVSS 9.8) in Bisheng, an open-source LLM application development platform maintained by DataElement. The flaw resides in the code validation logic exposed via the /api/v1/validate/code API endpoint, where attacker-supplied Python code is passed to Python’s exec() without sandboxing or sufficient restriction. Successful exploitation allows a remote attacker to achieve arbitrary code execution on the host running Bisheng, with no authentication or user interaction required.
Technical details
- Root cause: The validation routine backing the code-checking endpoint (
src/backend/bisheng/api/v1/validate.py, which calls intosrc/backend/bisheng/utils/validate.py) compiles and executes attacker-controlled Python source viaexec()without sandboxing, restricted builtins, or import controls. - Trigger conditions: A crafted payload submitted as the
codefield can embed executable logic in constructs that run during compilation/definition (e.g., a default-argument expression evaluated at function-definition time), causing code execution before any intended "validation" semantics apply. - Attack vector: Network-based; the vulnerable endpoint is
POST /api/v1/validate/code, reachable over HTTP(S) without requiring prior application state or user interaction. - Impact: Full compromise of confidentiality, integrity, and availability of the host process — arbitrary command execution with the privileges of the Bisheng backend service, potentially leading to full server takeover, data theft, or lateral movement.
Affected software
- Bisheng (dataelement/bisheng) version 2.3.0
- Bisheng version 2.4.0
- Bisheng version 2.4.0-beta1
Severity
- CVSS v3.1 Base Score: 9.8 (Critical)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Mitigation and recommended actions
- Immediate: As of disclosure, no dedicated patched release specifically addressing this
validate.pycode-injection issue has been confirmed by the project. Organizations should monitor the DataElement Bisheng GitHub repository and apply the latest available release or security fix as soon as one is published. - If no patch is available:
- Restrict network access to the Bisheng management/API interface to trusted internal networks or VPN only; do not expose it directly to the internet.
- Disable or block access to the
/api/v1/validate/codeendpoint (and related code-execution/validation endpoints) at the reverse proxy or API gateway if not strictly required. - Run Bisheng backend services with least-privilege, non-root accounts and in isolated/sandboxed containers to limit the blast radius of arbitrary code execution.
- Monitor logs for anomalous requests to code-validation and workflow-execution endpoints, and for unexpected process spawning from the Bisheng backend.

