CVE-2023-46315
📋 TL;DR
This vulnerability in the Infinite Image Browsing extension for Stable Diffusion web UI allows remote attackers to read any local file on the server when Gradio authentication is enabled without proper secret key configuration. Attackers can exploit this via the /file?path= URL parameter to access sensitive files like /proc/self/environ containing credentials. Users running vulnerable versions of this extension with improper authentication settings are affected.
💻 Affected Systems
- zanllp sd-webui-infinite-image-browsing (Infinite Image Browsing extension)
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise through credential theft, privilege escalation, and data exfiltration of sensitive files including configuration files, SSH keys, and database credentials.
Likely Case
Unauthorized access to sensitive configuration files and environment variables leading to credential exposure and potential lateral movement within the network.
If Mitigated
No impact when proper authentication with secret key is configured or when extension is not internet-facing.
🎯 Exploit Status
Exploitation requires only HTTP requests to the vulnerable endpoint. The issue description includes specific exploitation examples like reading /proc/self/environ.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Commit 977815a and later
Vendor Advisory: https://github.com/zanllp/sd-webui-infinite-image-browsing/issues/387
Restart Required: Yes
Instructions:
1. Update the extension to commit 977815a or later. 2. Pull latest changes: git pull origin main. 3. Restart the Stable Diffusion web UI service.
🔧 Temporary Workarounds
Disable Gradio Authentication
allTemporarily disable Gradio authentication until patch can be applied
Modify webui-user.bat or webui-user.sh to remove --gradio-auth flag
Configure Secret Key Properly
allEnsure Gradio authentication uses a strong secret key
webui-user.bat --gradio-auth username:password --gradio-key your-strong-secret-key
🧯 If You Can't Patch
- Isolate the service behind a firewall and restrict access to trusted IPs only
- Implement network-level file access controls and disable the extension entirely
🔍 How to Verify
Check if Vulnerable:
Check if extension version is before commit 977815a AND Gradio authentication is enabled without secret key configuration
Check Version:
cd extensions/sd-webui-infinite-image-browsing && git log --oneline -1
Verify Fix Applied:
Verify extension is at commit 977815a or later: git log --oneline -1
📡 Detection & Monitoring
Log Indicators:
- HTTP requests to /file?path= with unusual file paths
- Access to /proc/self/environ or other sensitive paths
Network Indicators:
- Unusual file read patterns via HTTP GET requests
- Traffic to sensitive file paths from unauthorized sources
SIEM Query:
http.url:"/file?path=" AND (http.status:200 OR http.status:403)
🔗 References
- https://github.com/zanllp/sd-webui-infinite-image-browsing/issues/387
- https://github.com/zanllp/sd-webui-infinite-image-browsing/pull/368/commits/977815a2b28ad953c10ef0114c365f698c4b8f19
- https://github.com/zanllp/sd-webui-infinite-image-browsing/issues/387
- https://github.com/zanllp/sd-webui-infinite-image-browsing/pull/368/commits/977815a2b28ad953c10ef0114c365f698c4b8f19