CVE-2026-75062
Eval injection in lf.query lets unauthenticated attackers run arbitrary Python code.
- CVSS 9.2
- 95
- Input Validation and Sanitization
- Remote
Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') in the default lf.query Python protocol in Google langfun versions prior to 0.1.2 allows remote unauthenticated attackers to execute arbitrary Python code in the context of the host application via crafted prompt inputs that cause the model to generate executable Python expressions evaluated without a sandbox.
- CWE
- 95
- CVSS base score
- 9.2
- Published
- 2026-08-26
- OWASP
- A03 Injection
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Command Injection
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Python
- Fixed by upgrading
- Yes
Solution
Upgrade to google‑langfun >= 0.1.2, which removes the unsafe lf.query default protocol and adds proper sandboxing for evaluated code.
Vulnerable code sample
import ast
class QueryHandler:
def __init__(self):
self.context = {"math": __import__("math")}
def run_prompt(self, prompt: str):
# VULNERABLE: eval on raw prompt allows code injection
result = eval(prompt, {}, self.context)
return resultPatched code sample
import ast
class QueryHandler:
def __init__(self):
self.context = {"math": __import__("math")}
def run_prompt(self, prompt: str):
# FIX: parse with literal_eval to restrict to literals
try:
result = ast.literal_eval(prompt)
except (ValueError, SyntaxError):
raise ValueError("Invalid input")
return resultPayload
__VAITP_MODEL_REFUSED__
Cite this entry
@misc{vaitp:cve202675062,
title = {{Eval injection in lf.query lets unauthenticated attackers run arbitrary Python code.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-75062},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-75062/}}
}
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 ::
