| 제목 | pyspur-dev pyspur <= 0.1.18 Server-Side Template Injection (SSTI) (CWE-1336) |
|---|
| 설명 | # Technical Details
A Server-Side Template Injection (SSTI) exists in the `apply_template` method in `backend/pyspur/rag/chunker.py` and `backend/pyspur/nodes/subworkflow/base_subworkflow_node.py` of pyspur.
The application fails to sandbox Jinja2 templates, evaluating raw `jinja2.Template()` without a `SandboxedEnvironment`.
# Vulnerable Code
File: backend/pyspur/rag/chunker.py
Method: apply_template
Why: Without wrapping the template engine in a SandboxedEnvironment, Jinja2 exposes its native global namespace to the evaluation context. An attacker can use standard Jinja2 built-in functions, such as `lipsum`, to traverse object attributes to reach the `__globals__` dictionary and execute system commands.
# Reproduction
1. Construct and send a POST request to `/api/rag/collections/preview_chunk/`.
2. Provide a payload using `{{ lipsum.__globals__['os'].popen('commands').read() }}` in the `chunking_config` JSON.
3. The server renders the Jinja2 template and executes the OS command.
# Impact
- Remote Code Execution (RCE) on the underlying server.
- Exfiltration of sensitive API keys and environment variables.
|
|---|
| 원천 | ⚠️ https://gist.github.com/YLChen-007/6fd98811ed9a6ad23d1d67e297d143a7 |
|---|
| 사용자 | Eric-b (UID 96354) |
|---|
| 제출 | 2026. 04. 06. AM 05:44 (5 개월 ago) |
|---|
| 모더레이션 | 2026. 04. 25. PM 03:49 (19 days later) |
|---|
| 상태 | 중복 |
|---|
| VulDB 항목 | 313638 [PySpur-Dev pyspur 까지 0.1.18 Jinja2 Template single_llm_call.py SingleLLMCallNode user_message 권한 상승] |
|---|
| 포인트들 | 0 |
|---|