Skip to main content

DSPy CVE-2026-72742

| EUVDEUVD-2026-56886 CRITICAL
External Control of File Name or Path (CWE-73)
2026-08-11 VulnCheck GHSA-vg2p-rf25-4wrx
9.2
CVSS 4.0 · Vendor: VulnCheck
Share

Severity by source

Vendor (VulnCheck) PRIMARY
9.2 CRITICAL
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
vuln.today AI
8.6 HIGH

No DSPy-side authentication (PR:N) and low complexity once model output is influenced; arbitrary file read exfiltrated across a trust boundary yields S:C and C:H, with no integrity or availability impact.

3.1 AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
X

Lifecycle Timeline

3
Source Code Evidence Fetched
Aug 11, 2026 - 20:11 vuln.today
Analysis Generated
Aug 11, 2026 - 20:11 vuln.today
CVE Published
Aug 11, 2026 - 18:50 cve.org
CRITICAL 9.2

DescriptionCVE.org

DSPy 3.3.0b1 contains a file exfiltration vulnerability in the Image and Audio output field adapters that allows attackers with influence over language model outputs to read arbitrary local files by injecting a filesystem path into the url field of a parsed Image or Audio typed output. The JSONAdapter and ChatAdapter parse untrusted language model completions through parse_value into TypeAdapter validation, which triggers encode_image or encode_audio to read and base64-encode any local file path via the os.path.isfile branch in image.py and audio.py, subsequently embedding the file contents into outgoing prompt messages sent to the attacker-controlled model endpoint.

AnalysisAI

Arbitrary local file read in Stanford NLP's DSPy 3.3.0b1 lets an attacker who controls or influences language-model completions exfiltrate host files by returning an Image or Audio typed output whose url field contains a local filesystem path. When JSONAdapter or ChatAdapter parse the completion, the framework reads and base64-encodes the referenced file and embeds it in the next outbound prompt to the attacker-controlled model endpoint. Reported by VulnCheck with a CVSS 4.0 base of 9.2; no public exploit identified at time of analysis and it is not listed in CISA KEV.

Technical ContextAI

DSPy is a Python framework for programming language models using declarative signatures and adapters. Its JSONAdapter and ChatAdapter convert raw LM completions into typed output fields via parse_value, which hands the value to a pydantic TypeAdapter for validation. For Image and Audio types, that validation path reaches encode_image/encode_audio in image.py and audio.py, which contain an os.path.isfile branch: if the supplied url string resolves to an existing local file, the file is read and base64-encoded rather than treated as an opaque reference. This is a textbook CWE-73 (External Control of File Name or Path) issue - untrusted LM output is treated as an instruction to open a filesystem path. The 3.3 fix stops construction and adapter parsing from touching the filesystem or network, requiring explicit Image.from_path()/Image.from_url() (and Audio equivalents) for deliberate resource loading.

RemediationAI

Upgrade to the DSPy 3.3 line that includes fix commit c69136b29aca4c00ca6da7667f7b80783188980e (https://github.com/stanfordnlp/dspy/commit/c69136b29aca4c00ca6da7667f7b80783188980e), where constructing or validating Image, Audio, and File values no longer interprets locator-shaped strings as filesystem-read or network-fetch instructions and resource loading requires explicit from_path()/from_url() factories. If you cannot upgrade off 3.3.0b1 immediately, remove Image and Audio typed output fields from signatures whose completions come from untrusted or externally reachable models (trade-off: loses multimodal output parsing), and route DSPy only to trusted, first-party model endpoints so an adversary cannot craft the malicious url payload (trade-off: constrains model choice). Note that the replacement Image.from_url()/Audio.from_url() factories perform caller-initiated HTTP with redirect following and no SSRF allowlist, so validate any URLs derived from untrusted input before calling them. See the VulnCheck advisory and issue #10067 for details.

Share

CVE-2026-72742 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy