| 标题 | premsql v0.2.1 Code Injection |
|---|
| 描述 | A Remote Code Execution (RCE) vulnerability exists in the premsql library due to the unsafe usage of eval() on language model outputs. An attacker can use prompt injection to force the LLM to output malicious Python code, which is then executed by the server.
```python
try:
result = self.generator.generate(
data_blob={"prompt": prompt},
temperature=temperature,
max_new_tokens=max_new_tokens,
postprocess=False,
)
# VULNERABILITY HERE:
result = eval(result.replace("null", "None"))
error_from_model = None
assert "alternate_decision" in result
assert "suggestion" in result
```
The `result` variable contains the raw string output from the LLM. The application attempts to parse this as a Python dictionary using `eval()`. However, if the LLM output is manipulated to contain valid Python commands (e.g., `__import__('os').system('calc')`), `eval()` will execute them. |
|---|
| 来源 | ⚠️ https://github.com/Ka7arotto/cve/blob/main/premsql-rce/issue.md |
|---|
| 用户 | Goku (UID 80486) |
|---|
| 提交 | 2026-03-21 02時50分 (17 日前) |
|---|
| 管理 | 2026-04-05 07時12分 (15 days later) |
|---|
| 状态 | 已接受 |
|---|
| VulDB条目 | 355388 [premAI-io premsql 直到 0.2.1 followup.py eval result 权限提升] |
|---|
| 积分 | 20 |
|---|