Browse / Tool and Agent Misuse / CVE-2025-12695
DSPy does not properly restrict file reads
- Class
- Tool and Agent Misuse (filed by a model that read the advisory)
- Technique
- Path traversal and file access
- Also involves
- Direct Prompt Injection
- Affected
- dspy (PyPI)
- Gets past
- Sandbox or allowlist
- CVSS
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
- EPSS
- 0.3% chance of exploitation in 30 days
How it works, in short
The PythonInterpreter sandbox allows file reads beyond what it should, so agent code generated from user input can read sensitive host files. (Our summary, written by a model. The source text is below.)
Details
The overly permissive sandbox configuration in DSPy allows attackers to steal sensitive files in cases when users build an AI agent which consumes user input and uses the “PythonInterpreter” class.
References
- https://nvd.nist.gov/vuln/detail/CVE-2025-12695
- https://github.com/stanfordnlp/dspy
- https://research.jfrog.com/vulnerabilities/dspy-sandbox-escape-arbitrary-file-read-jfsa-2025-001495652
Source: GitHub Advisory Database, used under CC BY 4.0.